How to assign a dynamic value to input List property in angular - html

I want to render multiple dropdowns in angular based on the result from api.
From the api 2 dropdown controls are returned with different data however my code shows same data for both of the controls
Can anyone suggest how to assign a dynamic value to the property "list" in the input element?. I think if that is possible my problem would be solved or please let me know if there is any other solution

As list is an input attribute not a property, you can assign dynamic value to list using:
[attr.list] ='object.property'.
for more info see the issue

Related

Grid inside an Access form

I was looking through some Access templates, and bumped into the Task Database.
It uses a grid inside a form, but I can't understand what component it's using:
When I look in Design View I can only see a list of fields:
I guess this is pretty basic and sure it's covered in MSDN, but it seems I'm unable to find proper search keywords.
It's a Format Property of the Form.
In the Property Sheet, the property Default View must be set on Split Form.
You can choose whether the datasheet is on top or below the form by changing the property Split Form Orientation.
You can adjust the splitter to view the datasheet only and then hide the splitter handle by changing to No the property Split Form Splitter.

Removing items on click based on checkbox status using angularjs

I am using this Plunkr. It displays a list of products. When I click on remove button, the items which are checked should be removed from the list.
<button ng-click="onClick()" class="k-button">Remove</button>
I have tried various things however, nothing is working. I am not exactly getting what logic should go in the following logic
$scope.onClick = function () {
}
I know it is something very simple however, I am not able to get it. Any help would be appreciated.
If you ask about logic, i will try to explain it here..
First inside onClick function get your gird's datasource variable, then find all selected checkboxes and use jquery each to iterate over each checkbox and find closest data-uid attribute. Every grid row has uid in its DOM, with this uid value get kendo observable object from datasource with getByUid method.
Last using datasource pass this observable object to remove method of datasource.
This is Kendo datasource API, hopes it helps you to write the code..

Dynamic repeater with Flex 4

I have the problem and not find the solution on Internet. I am using the repeater control the use add the check boxes. First time i have the array length 10 and i bind this array to repeater and also use the label property of check box to bind the label. First time it work fine but the second time i change the array length from 10 to 5. I passed this array to repeater data provider but it through the exception of Null. I didn't recreate the component but only change the array length on button click event.
Adnan, have you tried this
http://blog.flexexamples.com/2008/05/29/displaying-checkbox-controls-using-the-repeater-in-flex/
Consider providing your code next time you post any question so that it can be checked.

Kendoui web checkbox data binding

Hi I'm not sure if i'm using the right words in the title, please correct me if not. I've been working for almost a month with kendo ui. It's really good.
Now my problem, i'm working with html, django and kendo. I'm getting information from a url in json format. I'm able to load the information in a Kendo Grid, with a boolean values column and a text column. In the boolean values column i've found a way to turn it into a checkbox input column with a field template and set its checked value according to the data i got from the url. The problem is that I can't manage to bind the checked value to the data in the grid's datasource, so when I click the save button to save the new information I get the same data I got from the url. Does anybody know how to do this or a simpler way to do it instead of mine? Thank you!
There is a code library project which covers almost the same scenario. You could use the same idea to update the underlying model which the Grid uses.
http://www.kendoui.com/code-library/mvc/grid/checkbox-column-and-incell-editing.aspx

How can I make a custom JSON Reply (derived from a QueryReadStore) map to a dijit FilteringSelect?

I have some problems getting the custom formated JSON data into a dijit.form.FilteringSelect. It might be that this is the same for other types of dijit select boxes.
update:
One difference when using a FilteringSelect instead of a ComboBox is that validation errors
ar now shown on the element. All input is returning an "invalid value" tooltip.
Here is some sample JSON wich is returned from a database via PHP converted from
an result array:
{"animals":[
{"gr_id":"1","gr_name":"Dog","gr_description":null},
{"gr_id":"4","gr_name":"Cat","gr_description":null}]}
Here is the HTML code for displaying the combo box and defining the store:
<div dojoType="dojox.data.QueryReadStore" url="getAnimals.php" jsId="animalStore">
</div>
<select dojoType="dijit.form.FilteringSelect" store="animalStore" searchAttr="gr_name">
</select>
The search Attribute is processed correctly and the above response is sent back to the client, but the box remains empty.
I do not know how to map the custom JSON response to the label (value displayed as options and used for search : gr_name) and value (value returned on submit : gr_id) position of the dijit select box (FilteringSelect).
When I have been searching for examples, it always seems to work like magic, but I guess that is because they use a default structure for the json data. I can't even confirm this, because the documentation is a bit scarse on those features.
Just extend the QueryReadStore and change the implementation to match your backend. Have a look at the various stores under dojox/data (http://trac.dojotoolkit.org/browser/tags/release-1.5.0/dojox/data) for examples of how to do this.
It's hard to be more specific without knowing more about your backend. But if you look at the flickr store or any of the other stores which map to pre-existing non-dojo data sources you'll get the idea.
I haven't found the sollution I was looking for, but I have fount a workaround at least.
It seems the JSON needs to be delivered in a specific Format to be processed by a dijit.form.FilteringSelect (or related boxes)
The array needs to be called "items" and the names of the identifier and the label need to be given along with the response JSON:
{identifier: "gr_id",
label: "gr_name",
items: [{"gr_id":"1", "gr_name":"Cat","gr_description":null}]}
Since I was looking for a way to make the server side code independent of the view sollution this is not my favourite sollution...