Loading ...
Sorry, an error occurred while loading the content.

Do a programmatically selection of a datatable row

Expand Messages
  • Andrés Reyes Douglas
    Hi, I need to select a row on a datatable. Simply, but no selecting by the row number (0,1,2,3,etc.). I ve a hide column named Code with unique number
    Message 1 of 2 , Jun 30, 2009
    • 0 Attachment
      Hi,
      I need to select a row on a datatable. Simply, but no selecting by the row number (0,1,2,3,etc.). I've a hide column named "Code" with unique number values, then... how can i programmatically select the row with code=45? (for example)

      Thanks
    • Satyam
      There is nothing built into the DataTable to help you on this. If it is going to happen just once, simply loop through the Recordset looking for the value you
      Message 2 of 2 , Jun 30, 2009
      • 0 Attachment
        There is nothing built into the DataTable to help you on this. If it is
        going to happen just once, simply loop through the Recordset looking for
        the value you want. If the selection is going to happen more than once,
        it might be good to create an index. You can do it once the DataTable
        is loaded, by listening to the initEvent and built an array with the
        Code as index and the Record as its value.

        http://developer.yahoo.com/yui/docs/YAHOO.widget.DataTable.html#event_initEvent

        JavaScript arrays are sparse, which means, only the elements that have
        contents take up memory, if you set element 10 in an array, you are not
        reserving space for all the previous ones so your Code numbers don't
        need to be sequential. Also, since objects are copied by reference,
        storing a reference to each Record object won't be particularly expensive.

        You can also use the formatRow function to fill in the array while the
        DataTable is being built without actually formatting anything.

        http://developer.yahoo.com/yui/docs/YAHOO.widget.DataTable.html#config_formatRow

        Satyam

        Andrés Reyes Douglas escribió:
        > Hi,
        > I need to select a row on a datatable. Simply, but no selecting by the row number (0,1,2,3,etc.). I've a hide column named "Code" with unique number values, then... how can i programmatically select the row with code=45? (for example)
        >
        > Thanks
        >
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >
        > ------------------------------------------------------------------------
        >
        >
        > No virus found in this incoming message.
        > Checked by AVG - www.avg.com
        > Version: 8.5.375 / Virus Database: 270.13.1/2211 - Release Date: 06/30/09 11:37:00
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.