To adjust row height depending on content in TreeGrid

Find code here before you post.

To adjust row height depending on content in TreeGrid

Postby linb » Fri May 24, 2013 12:47 am

   
Class('App', 'xui.Com',{
Instance:{
iniComponents : function(){
// [[Code created by CrossUI RAD Tools
var host=this, children=[], append=function(child){children.push(child.get(0))};

append(
(new xui.UI.Block)
.setHost(host,"ctl_block2")
.setLeft(70)
.setTop(40)
.setWidth(500)
.setHeight(330)
.setBorderType("inset")
);

host.ctl_block2.append(
(new xui.UI.TreeGrid)
.setHost(host,"ctl_treegrid2")
.setRowNumbered(true)
.setHeader([{"id":"col1", "width":80, "type":"input", "caption":"col1"}, {"id":"col2", "width":80, "type":"input", "caption":"col2"}, {"id":"col3", "width":80, "type":"input", "caption":"col3"}, {"id":"col4", "width":80, "type":"input", "caption":"col4"}])
.setRows([{"cells":[{"value":"first row<br/> first col", "id":"c_a"}, {"value":"first row<br/> 2nd col", "id":"c_b"}, {"value":"first row<br/> 3rd col", "id":"c_c"}, {"value":"first row<br/> 4th col", "id":"c_d"}], "id":"e"}, {"cells":[{"value":"2rd row<br/> first col", "id":"c_e"}, {"value":"2rd row<br/> 2nd col", "id":"c_f"}, {"value":"2rd row<br/> 3rd col", "id":"c_g"}, {"value":"2rd row<br/> 4th col", "id":"c_h"}], "id":"f"}, {"cells":[{"value":"3rd row<br/> first col", "id":"c_i"}, {"value":"3rd row<br/> 2nd col", "id":"c_j"}, {"value":"3rd row<br/> 3rd col", "id":"c_k"}, {"value":"3rd row<br/> 4th col", "id":"c_l"}], "id":"g"}, {"cells":[{"value":"4th row<br/> first col", "id":"c_m"}, {"value":"4th row<br/> 2nd col", "id":"c_n"}, {"value":"4th row<br/> 3rd col", "id":"c_o"}, {"value":"4th row<br/> 4th col", "id":"c_p"}], "id":"h"}])
.onRender("_ctl_treegrid2_onrender")
);

return children;
// ]]Code created by CrossUI RAD Tools
},
_ctl_treegrid2_onrender : function (profile){
profile.boxing().autoRowHeight();
}
}
});
   
linb
Site Admin
 
Posts: 102
Joined: Thu Apr 25, 2013 6:51 am

Return to CrossUI Code Snaps

Who is online

Users browsing this forum: No registered users and 0 guests

cron