Disabling Datagrid selection in flex - actionscript-3

i have an array list of data which i am showing in spark data grid.
once i select an idem and click on a button that i have linked with datagrid it adds a panel on screen. I want to disable this selection i-e to tell that this item panel have already been added. Any ideas how can i do that?
best Regards

Try this.contains(child:DisplayObject) It Determines whether the specified display object is a child of the DisplayObjectContainer instance or the instance itself. The search includes the entire display list including this DisplayObjectContainer instance. Grandchildren, great-grandchildren, and so on each return true.

I think there's a .disable() function on datagrids, or you can use return false; so that it won't proceed.

Related

How to instruct an element to update it's model from outside

In my polymer app, I have one element containing a list of items, and another element with the form to CRUD these items.
After inserting a new item from the form-element, how can I instruct the other element to re-pull the model data ? (and thus redraw the list items)
I'm using Firing custom events.
Suppose core-ajax is used for inserting a new item, on core-ajax response fire the event 'insert_done'.
List element should catch that event and get the items, this time with the new one in.
...
This is some general answer, but you can share some code for more specific answer.
Either lookup the list using a dom query and call an update method. Or, bind a variable that is used to notify the list of the change. Use an observer, in the list element, to execute the update code when the property value is changed by the form element.

how can I code different events for Add to Listview and Reorder Listview in Winrt

I am having trouble getting code to fire when a listview has items reordered. I created an event handler for collectionchanged, but that fires when an item is added. I want it only to fire when it is reordered, but reordered in Winrt is a combination of remove and add.
The more general idea of what I want to do is create two listviews of items, where the first listview's items rearrange if corresponding items in the second listview are reordered by the user using drag and drop. I'm pretty close to getting it to work. I have id numbers for elements in both lists.
First, make sure you are using an observable collection.
Second, read this: XAML/C#: What event fires after reordering a gridview?
Best of luck!

get longlistselector item at a particular index

In my WP8 app i have a longlistselector which includes CheckBox in its itemtemplate.
I want to set the IsChecked property of each checkbox in my list at run-time.
For doing this i figured i would need to loop through the items in the list and get access to the checkbox instance in each item and set its property.
But i cant find a way to get reference to a list item at a particular index in the longlistselector.
Can someone please guide me with this?? i am pretty new to this platfom.
Thanks!

AS3 Datagrid multiple selection

I am working with Flash AS3 (not Flex) .
I have a datagrid with "allowMultipleSelection = true";
I want get and store the selected rows in my Data Base only when the row selection is completed using a button. (I don't want use "ListEvent.ITEM_CLICK" because a row can be selected and removed from the selection using the CTRL key)
How can I retrieve the selected rows in the datagrid?
Assuming you are using fl.controls.DataGrid, you can use the selectedItems property (it's an Array) to get (or set) the selected items when your button is clicked.
I had a datagrid which had checkboxes which use to get checked when a datagrid row was clicked. I wanted to allow multiple selections and also make the corresponding rows as checked or unchecked depending whether they are selected using shift key. I was able to do so by using the contains method of arraycollection and then checking the checkbox.

Two renderers in same adavanced data grid in Flash builder

i have a data grid which is having two renderers. one is text box and other is dropdwon. both are mxml rendered.
My requiremnet is when user edit the textbox value in a particular row i should make the dropdown value also changed of that particular row.
Could someone help me on this.
thanks
If this is spark:
The ItemRenderer has a property owner which is the dataGrid - you'll want to add an eventlistener on this (from the combobox one) - presumably coming from the other renderer which you dispatch from the owner point of view (eg: in textboxitemeditor: owner.dispatchEvent(RendererEvent.CHANGE, value))
In this listener - when the appropriate data was edited, you can update your combo box appropriately.
The key when doing something like this, is to remember to remove the listener and any other references you create in the dispose() method.
If this is halo:
It's essentially almost the same as above, the difference is there is a baseListData object which has the owner reference from the renderer.