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

preselecting a checkbox editor in a datatable

Expand Messages
  • zahu71
    I have a datatable that has a checkbox editor column with an enumeration of 3 values for example : editorOptions:{checkboxOptions:[ red , green , blue ]} I
    Message 1 of 2 , Jan 7, 2008
      I have a datatable that has a checkbox editor column with an
      enumeration of 3 values for example :
      editorOptions:{checkboxOptions:["red","green","blue"]}
      I want to be able to preselect the checkboxes based on ID's or keys
      not based on labels. I want to pass to the datatable the id of "red"
      or "green" colors so that it preselects them. Same way when I read the
      value from the data column I want to be able to read the id and
      resolve it.
      Can I do that with the datatable component?

      Thanks
    • Satyam
      Unfortunately not, and that would be a good feature to have. As it stands, the label value is the internal value as well. You should be able to specify
      Message 2 of 2 , Jan 7, 2008
        Unfortunately not, and that would be a good feature to have. As it stands,
        the label value is the internal value as well. You should be able to
        specify something like:

        editorOptions:{checkboxOptions:[{label:"red",value:0},{label:"green",value:1},{label:"blue",value:2}]}

        And actually, the code is halfway there since it can take the label property
        but not the value.
        You will have to override:

        YAHOO.widget.DataTable.editCheckbox

        with your own version. Check for variable checkboxValue and create your own
        checkboxLabel and use each in the proper places. When you have your
        corrected version, please submit it to SourceForge so it will be there in a
        future version. Thanks

        Satyam


        ----- Original Message -----
        From: "zahu71" <zaherhammoud@...>
        To: <ydn-javascript@yahoogroups.com>
        Sent: Monday, January 07, 2008 3:37 PM
        Subject: [ydn-javascript] preselecting a checkbox editor in a datatable


        >I have a datatable that has a checkbox editor column with an
        > enumeration of 3 values for example :
        > editorOptions:{checkboxOptions:["red","green","blue"]}
        > I want to be able to preselect the checkboxes based on ID's or keys
        > not based on labels. I want to pass to the datatable the id of "red"
        > or "green" colors so that it preselects them. Same way when I read the
        > value from the data column I want to be able to read the id and
        > resolve it.
        > Can I do that with the datatable component?
        >
        > Thanks
        >
        >
        >
        >
        >
        >
        > Yahoo! Groups Links
        >
        >
        >
        >
        >
        > --
        > No virus found in this incoming message.
        > Checked by AVG Free Edition.
        > Version: 7.5.516 / Virus Database: 269.17.13/1212 - Release Date:
        > 06/01/2008 22:55
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.