This content has been marked as final. Show 7 replies
Do you want the items to remain un-editable only for the duration of this session, or whenever the same user logs back on to that screen?
For a session-only duration, I can picture this being handled by a pair of booleans on the objects in question, both false by default. When he edits the datagrid item, set a holder boolean to 'true'. When he clicks the 'submit' button, loop through the array collection, and wherever you have a holder boolean set to 'true', set the second boolean, the permanent boolean, to 'false'.
I have attached the examples of what I'm talking about.
What is the arrayProvider, the dataProvider of the grid?
Sorry I think the arrayProvider is the dataProvider of the grid
Yes, it is. Sorry that's a bit confusing, I didn't really specify.
Also, in looking at my editorHandler function, it needs some changes. Right now it will prevent editing of an entire row when the corresponding boolean is set. In order to prevent editing of just the one cell, it should look more like this:
What I want is once the submit button is pressed,the changes will be made in the database.So after that the user cannot change the values for those particular rows.Only for the rest of the rows can the user choose a value using combobox...
The only way I can see to do that would be to have the database default to null values in all the columns, and then check for that with your edit handler. We use managed collections at work, which means a second collection would be required; one to store the temporarily selected values, the other to stay connected to the data in the dataBase. Edit the temporary collection, and then when the Submit button is clicked, copy the temporary collection over to the one linked collection. Maybe one of the more experienced users on here has another solution? I don't know.
This is the kind of event handler I am talking about, BTW:
null or empty string or zero of some other known value.
But first be sure your itemrenderer is working correctly.
You ComboBox renderer must be updating the dataProvider item when the user interacts with it.
Then, I might use the renderer to determine whether a use can interact with a cell. If the value has the empty or null or whateve value then the rendere shows the combo box, otherwise it shows a label.