TreeGrid.setRows and getRows("min")

Develop and Deploy Native Apps for Windows, OS X, Linux, Unix ...

TreeGrid.setRows and getRows("min")

Postby wahono77 » Fri Nov 29, 2013 9:44 pm

javascript code
// The default code is a com class (inherited from xui.Com)
Class('App', 'xui.Com',{
// Ensure that all the value of "key/value pair" does not refer to external variables
Instance:{
// To initialize instance(e.g. properties)
initialize : function(){
// To determine whether or not the com will be destroyed, when the first UI control be destroyed
SPA = this;
this.autoDestroy = true;
// To initialize properties
this.properties = {};
},
// To initialize internal components (mostly UI controls)
// *** If you're not a skilled, dont modify this function manually ***
iniComponents : function(){
// [[Code created by CrossUI RAD Tools
var host=this, children=[], append=function(child){children.push(child.get(0));};

append((new xui.UI.Tabs())
.setHost(host,"ctl_tabs5")
.setItems([{"id":"a", "caption":"page1", "image":"img/demo.gif"}, {"id":"b", "caption":"page2", "image":"img/demo.gif"}, {"id":"c", "caption":"page3", "image":"img/demo.gif"}, {"id":"d", "caption":"page4", "image":"img/demo.gif", "closeBtn":true, "optBtn":true, "popBtn":true}])
.setValue("a")
);

host.ctl_tabs5.append((new xui.UI.TreeGrid())
.setHost(host,"ctl_treegrid17")
.setDock("none")
.setLeft(10)
.setTop(20)
.setWidth(400)
.setHeight(250)
.setRowNumbered(true)
.setHeader([{"id":"filename", "width":300, "type":"helpinput", "editable":true, "caption":"Filename", "editorProperties":{"commandBtn":"pop"}, "editorEvents":{"onCommand":function (profile,src){}}, "editorListItems":[{"id":"default1", "caption":"Default 1"}, {"id":"default2", "caption":"Default 2"}, {"id":"default3", "caption":"Default 3"}, {"id":"default4", "caption":"Default 4"}, {"id":"default5", "caption":"Default 5"}]}, {"id":"description", "width":700, "type":"input", "editable":true, "caption":"Deskripsi"}])
.setRows([{"cells":[{"value":"img/1.png", "id":"c_a"}, {"value":"Contoh slide 1", "id":"c_b"}], "id":"ac"}, {"cells":[{"value":"img/2.png", "id":"c_c"}, {"value":"Contoh slide 2", "id":"c_d"}], "id":"ad"}, {"cells":[{"value":"img/3.png", "id":"c_e"}, {"value":"Contoh slide 3", "id":"c_f"}], "id":"ae"}, {"cells":[{"value":"img/4.png", "id":"c_g"}, {"value":"Contoh slide 4", "id":"c_h"}], "id":"af"}, {"cells":[{"value":"img/5.png", "id":"c_i"}, {"value":"Contoh slide 5", "id":"c_j"}], "id":"ag"}, {"cells":[{"value":"img/6.png", "id":"c_k"}, {"value":"Contoh slide 6", "id":"c_l"}], "id":"ah"}, {"cells":[{"value":"img/7.png", "id":"c_m"}, {"value":"Contoh slide 7", "id":"c_n"}], "id":"ai"}])
, "b");

host.ctl_tabs5.append((new xui.UI.SButton())
.setHost(host,"ctl_sbutton6")
.setLeft(50)
.setTop(130)
.setWidth(190)
.setCaption("Fill rows simple mode")
.onClick("_ctl_sbutton6_onclick")
, "a");

host.ctl_tabs5.append((new xui.UI.SButton())
.setHost(host,"ctl_sbutton24")
.setLeft(50)
.setTop(80)
.setWidth(190)
.setCaption("Fill rows complete mode")
.onClick("_ctl_sbutton24_onclick")
, "a");

host.ctl_tabs5.append((new xui.UI.SButton())
.setHost(host,"ctl_sbutton55")
.setLeft(50)
.setTop(190)
.setWidth(200)
.setCaption("Get Min Data")
.onClick("_ctl_sbutton55_onclick")
, "a");

return children;
// ]]Code created by CrossUI RAD Tools
},
// Give a chance to load other com
iniExComs : function(com, threadid){
},
// Give a chance to determine which UI controls will be appended to parent container
customAppend : function(parent, subId, left, top){
// "return false" will cause all the internal UI controls will be added to the parent panel
return false;
},
// This instance's events
events : {"onReady":"_com_onready"},
_com_onready:function (com,threadid){

},
_ctl_sbutton6_onclick:function (profile,e,src,value){
var ns = this, uictrl = profile.boxing();
ns.ctl_treegrid17.setRows([["img/1.png","Contoh slide 1"],["img/2.png","Contoh slide 2"],["img/3.png","Contoh slide 3"]]);
},
_ctl_sbutton24_onclick:function (profile,e,src,value){
var ns = this, uictrl = profile.boxing();
ns.ctl_treegrid17.setRows([{"cells":[{"value":"img/1.png","id":"c_a"},{"value":"Contoh slide 1","id":"c_b"}],"id":"ac"},{"cells":[{"value":"img/2.png","id":"c_c"},{"value":"Contoh slide 2","id":"c_d"}],"id":"ad"},{"cells":[{"value":"img/3.png","id":"c_e"},{"value":"Contoh slide 3","id":"c_f"}],"id":"ae"}]);
},
_ctl_sbutton55_onclick:function (profile,e,src,value){
var ns = this, uictrl = profile.boxing();
xui.alert(_.serialize(ns.ctl_treegrid17.getRows("min")));
}
}
});


Please click "Fill row complete mode" than click "Get Min Data", you get true result.
Please click "Fill row simple mode" than click "Get Min Data", you get null result until you click second tab.

I think simple row mode should be relayout or others command. How to fix it?

Thanks
wahono77
 
Posts: 90
Joined: Sat Apr 13, 2013 6:04 am

Re: TreeGrid.setRows and getRows("min")

Postby support » Sat Nov 30, 2013 12:23 pm

We fixed it in SVN.
support
 
Posts: 352
Joined: Sat Apr 27, 2013 9:22 am

Re: TreeGrid.setRows and getRows("min")

Postby wahono77 » Sun Dec 01, 2013 8:41 pm

Thanks, fixed now
wahono77
 
Posts: 90
Joined: Sat Apr 13, 2013 6:04 am


Return to CrossUI for Desktop Apps

Who is online

Users browsing this forum: No registered users and 0 guests

cron