how to make the last row of an as3 advanced datagrid editable while all other rows are not editable - actionscript-3

I'm trying to make a single row of a data grid editable. so if I have 5 rows of complete data these will remain uneditable. however I will have added an additional empty row and this is the only row I want the user to have access to edit. this is being done using as3 in and advanced data grid.
using the editable property of the data grid I have made the entire grid editable but this will be an unacceptable outcome

Specify editable property of datagrid as true but specify all the colums of datagrid editable property false
On ItemClick event check the rowindex.
If rowindex == 5(where u want ur datagrid to be edited) use editable property of datagrid for all colums to true else false
Hope you got it!!!
Source: https://forums.adobe.com/thread/665669

Related

Clear selection for Kendo Grid in Angular 2

I've got an application that allows a user to select a row in a Kendo Angular 2 grid and click a button that removes that row. After the row is removed, however, the grid selection persists on the index of the row that was just removed. I'd like to clear the grid's selection after the button is clicked and the row is removed. For the life of me, I cannot find a way to do this. Any ideas?
The Kendo Grid control has a property of "selectedKeys" which binds to an array of numbers. You can then clear this array when you want to clear the selection of the grid.
<kendo-grid
[selectedKeys]="mySelection"></kendo-grid>
In your code:
this.mySelection = [];

How to add a custom component in Datagrid on first empty row?

I am loading some data from a database table in a datagrid in Flex and I require a custome component on the first empty row or on empty rows, so user can add data in to that row. How can I do that? I do not want to make the datagrid column editable.

add a row to a datagrid where a user can input data in as3

what i am trying to achieve is to have data populate a datagrid from a query, this part works fine. but once the data has been populated i want to add an additional row which the user will be able to type into. so for example the grid will have 5 pre populated rows and then the 6th row will be empty cells which the user can edit. the final column of this row will either be a button or an image with the click property set. this will be used to run an update query to update the dataprovider of the datagrid.
This is pretty easy. Just add a new object in your List that is bound to the datagrid. For the final column you will need an item renderer.
Ex:
dataGrid.dataProvider = someList;
//later when it is populated
someList.addItem(new Item());
After this you can set the focus to the desired column and the last row to show its input time.
You can also remove the last added item from the list to simulate a cancel action.
You will also need to set the 'editable' property of the grid to true. Set the selectionMode property to 'singleRow' Each column also has an individual 'editable' property so you can limit users to only changing certain properties.
As long as the data is simple text the default item editor (which is a textInput) will work fine. If you use an advancedDataGrid you can also include things like checkBoxes for Boolean data.

Programmatically deselecting a row in JTable

I want to programmatically deselect a row in JTable. Basically I have cehckbix in my jtable and my row needs to be selected or highlited when I click on checkbox. CLicking in any other column should not highlight the row.
I tries table.removeRowSelectionInterval(row,row) on clicking in cell other than checkbox it did not work.
I tried ListSelectionModelk.clearSelection() and then adding RowSelectionInterval() for rows as needed, it works but it interfere with some other functionality.
So I can't use this.
As #Nizil commented that you can write your own Cell Renderer or Cell Renderer
You also need to look at How to use Tables and How to use CheckBoxes

AdvancedDataGrid: row moves to the bottom of the ADG when editing a value

I have an AdvancedDataGrid with editable set true on some columns. If i edit one of the values in the ADG, the row moves to the bottom of the node/branch containing the items im currently editing.
My AdvancedDataGrid is defined in ActionScript3, and i use a grouping collection to group a flat dataProvider.
My problem is that i often want to edit several cells of one row, and if i edit one of the cells and then click somewhere else, the row moves to the bottom of the ADG. How can i avoid this? I want the row to stay selected and at the same index.
I guess i was a bit to quick to post this question, but maybe my mistake helps someone else. At the time of creating the editing, i didnt know about the itemUpdate(object) method of the ArrayCollection, so i removed the item, updated the item and then added it to the same index again(code below):
ac.removeItemAt(i);
ac.addItemAt(event.itemRenderer.data, i);
This does not work together with the hierarchical data in the AdvancedDataGrid. Insead of beeing inserted back in the right index it is displayed at the bottom of the current branch in the ADG. The solution was very simple by using the following code, which works with the GroupingCollection:
var field:String = event.dataField;
var obj:Object = event.itemRenderer.data;
//Update the field that was edited by the user
obj[field] = editedValue;
//update the object in the dataProvider
ressursTavle.itemUpdated(obj);