liltyga
asked on
Get value of selected item from dataGrid component
Hi,
I have a datagrid that is pulling data in dynamically from a database. There are three fields of data that are being queried, and what I need to do is check if one of those fields equals a certain criteria, and if true, make the button selectable.
Basically, I would draw out the desired functionality like this:
dg_someData results:
field1 field2 field3
------ ------- -------
id1 title1 typea <------- if field3 = 'typea', btn_select enabled = true; else btn_select enabled = false
id2 title2 typeb
id3 title3 typec
[btn_select]
Can anyone help me out and let me know how I can determine the value of the data in 'field3' above, for dg_someData, and enable the select button if the selected item matches the criteria?
Thanks in advance!
I have a datagrid that is pulling data in dynamically from a database. There are three fields of data that are being queried, and what I need to do is check if one of those fields equals a certain criteria, and if true, make the button selectable.
Basically, I would draw out the desired functionality like this:
dg_someData results:
field1 field2 field3
------ ------- -------
id1 title1 typea <------- if field3 = 'typea', btn_select enabled = true; else btn_select enabled = false
id2 title2 typeb
id3 title3 typec
[btn_select]
Can anyone help me out and let me know how I can determine the value of the data in 'field3' above, for dg_someData, and enable the select button if the selected item matches the criteria?
Thanks in advance!
If with "button" you mean the whole row, then there's no property to do that (datagrid.selectable is a global property). You should create a custom cell renderer...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You are making it invisible after pressing on it?
ASKER
only if the criteria is not equal to 'typea' data - they shouldn't be allowed to submit an edit request for the other values
good work - showed me something:)
ASKER
thanks so much - that's something refreshing to hear :)
no worries - thanks for sharing the solution with us
billystyx
billystyx