?
Solved

Get value of selected item from dataGrid component

Posted on 2005-05-16
8
Medium Priority
?
3,956 Views
Last Modified: 2012-05-05
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!
0
Comment
Question by:liltyga
  • 3
  • 2
  • 2
7 Comments
 
LVL 27

Expert Comment

by:negatyve
ID: 14016343
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...
0
 

Accepted Solution

by:
liltyga earned 0 total points
ID: 14016346
I got it to work, and am posting the solution in case it is helpful, or someone knows of a better way to do it.

In the actionscript of the dataGrid component itself, I have the following:

on(cellPress) {
      trace("parent status is" + selectedItem.Status);
      
      if (selectedItem.Status == 'typea')
      {
            _parent.btn_select._visible = true;
      }
      if (selectedItem.Status == 'typeb')
      {
            _parent.btn_select._visible = false;
      }
      if (selectedItem.Status == 'typec')
      {
            _parent.btn_select._visible = false;
      }
      
}
0
 
LVL 27

Expert Comment

by:negatyve
ID: 14016494
You are making it invisible after pressing on it?
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 

Author Comment

by:liltyga
ID: 14016503
only if the criteria is not equal to 'typea' data  - they shouldn't be allowed to submit an edit request for the other values
0
 
LVL 18

Expert Comment

by:Billystyx
ID: 14016573
good work - showed me something:)
0
 

Author Comment

by:liltyga
ID: 14021659
thanks so much - that's something refreshing to hear :)
0
 
LVL 18

Expert Comment

by:Billystyx
ID: 14021733
no worries - thanks for sharing the solution with us

billystyx
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to how to record live broadcast.

588 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question