[ 3 posts ]

chengchangwu

  • Joined: Mon Mar 07, 2011 1:27 am
  • Posts: 2
  • Offline
  • Profile

current value of cell editor after initial request

Post Posted: Mon Mar 07, 2011 1:45 am
+0-
Hi,

I've setup my data table, my data source and the cell editor for the datatable as the following. The data field MD can take a value of 0, 1 or 2. After initial request the field MD is correctly shown as 2. But if I try to edit it, the value preselected by the cell editor is 0. How can I synchronize the current value of cell editors with values received from the data source?

Thanks.

Code:
         var myColumnDefs = [
                             {key:"MD", editor: new YAHOO.widget.DropdownCellEditor({dropdownOptions: [0, 1, 2], disableBtns:true}),
                                formatter:YAHOO.widget.DataTable.formatNumber, resizeable:true}
                             ];

         var myDataSource = new YAHOO.util.DataSource("json");
         myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
         myDataSource.connXhrMode = "queueRequests";
         myDataSource.responseSchema = {
               resultsList: "ResultSet.Result",
               fields: ["MD"]
         };

         var myDataTable = new YAHOO.widget.DataTable("ecode",
               myColumnDefs, myDataSource, {initialRequest:"?resultSetType=ecode"});

Alberto Santini

YUI Contributor

  • Offline
  • Profile

Re: current value of cell editor after initial request

Post Posted: Mon Mar 07, 2011 5:43 am
+0-
Hello chengchangwu.

Did you give a look at Satyam's Dynamic dropdownOptions example [1]?
And see also the ticket "DataTable Radio cell editor not autochecking selection when datatype is integer" [2].

Hope that helps,
IceBox

[1] http://www.satyam.com.ar/yui/2.8.0/DynamicDropdown.html
[2] http://yuilibrary.com/projects/yui2/ticket/2527749

chengchangwu

  • Joined: Mon Mar 07, 2011 1:27 am
  • Posts: 2
  • Offline
  • Profile

Re: current value of cell editor after initial request

Post Posted: Fri May 27, 2011 8:57 pm
+0-
It helps, thanks.
  [ 3 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum