| Page 1 of 1 | [ 4 posts ] |
|
After retrieve data and use Y.DataTable.addRow to add data, then I use DataTable's model to set value, this dose not effect on the web page. This is appeared when I upgrade YUI to 3.6.0.
Example: table is a instant of Y.DataTable table.addRow(....); //then the page coule display the table's data table.data.item(0).set("no", 1); //the page coule not display 1 at first row with column 'no' alert(table.data.item(0).get("no")); //the model is do set to 1 So what's the problem above when upgrade YUI to 3.6.0, this is correct when use YUI 3.5.1 |
|
Not quite sure what you are trying, can you post a code sample to demonstrate this?
This works, http://jsfiddle.net/blunderalong/ZnSVE/ using either .addRow() or .data.add() and .modifyRow() and .data.set() for both 3.5.0 and 3.6.0. |
|
I found the problem occurred by DataTable's recordType attribute:
YUI().use( "datatable", "cssfonts", function(Y){ Y.one("body").addClass("yui3-skin-sam"); var some_data =[ {no:0, fname:'jesse', status:1}, {no:0, fname:'gustavo', status:0}, {no:0, fname:'walter', status:1}, {no:0, fname:'hank', status:1}, {no:0, fname:'tuco', status:0} ]; var dtable = new Y.DataTable({ columns: ['no','fname','status'], data: some_data }).render('#divTable'); //notice this sentense dtable.set("recordType", dtable.get("columns")); Y.one("#btnChange").on("click",function(){ var modelList = this.data; for (var i = 0; i < modelList.size(); i++) { modelList.item(i).set("no", i); } },dtable); }); So when you click the button, the column 'no' value has no changed. This is happend when set the recordType, using datatable's Model.set or setAttrs had no effect, if omitted, then could set value by using Model.set.(Only YUI 3.6 occurd this problem) |
|
I have absolutely no idea what you are trying to accomplish
If this works for you, great! |
| Page 1 of 1 | [ 4 posts ] |
| 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 |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group