How to set a group columns in the header?

Find code here before you post.
Locked
support
Posts: 356
Joined: Sat Apr 27, 2013 9:22 am

How to set a group columns in the header?

Post by support »

   
Class('App', 'xui.Com',{
    Instance:{
        iniComponents : function(){
            // [[Code created by CrossUI RAD Studio
            var host=this, children=[], append=function(child){children.push(child.get(0));};
            
            append(
                (new xui.UI.Pane())
                .setHost(host,"ctl_pane6")
                .setLeft(10)
                .setTop(10)
                .setWidth(490)
                .setHeight(190)
            );
            
            host.ctl_pane6.append(
                (new xui.UI.TreeGrid())
                .setHost(host,"ctl_treegrid2")
                .setRowNumbered(true)
                .setHeaderHeight(60)
                .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"
                }])
                .setGrpCols([{
                    "id" : "1",
                    "caption" : "Group 1234",
                    "from" : 0,
                    "to" : 3,
                    "colResizer" : true
                },{
                    "id" : "3",
                    "caption" : "Group 12",
                    "from" : 0,
                    "to" : 1,
                    "colResizer" : true
                },{
                    "id" : "2",
                    "caption" : "Group 34",
                    "from" : 2,
                    "to" : 3,
                    "colResizer" : true
                }])
                );
            
            return children;
            // ]]Code created by CrossUI RAD Studio
        }
    }
});
Class('App', 'xui.Com',{
    Instance:{
        iniComponents : function(){
            // [[Code created by CrossUI RAD Studio
            var host=this, children=[], append=function(child){children.push(child.get(0));};
            
            append(
                (new xui.UI.Pane())
                .setHost(host,"ctl_pane6")
                .setLeft(10)
                .setTop(10)
                .setWidth(490)
                .setHeight(190)
            );
            
            host.ctl_pane6.append(
                (new xui.UI.TreeGrid())
                .setHost(host,"ctl_treegrid2")
                .setRowNumbered(true)
                .setHeaderHeight(60)
                .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"
                }])
                .setGrpCols([{
                    "id" : "1",
                    "caption" : "Group 1234",
                    "from" : 0,
                    "to" : 3,
                    "colResizer" : true
                },{
                    "id" : "3",
                    "caption" : "Group 12",
                    "from" : 0,
                    "to" : 1,
                    "colResizer" : true
                },{
                    "id" : "2",
                    "caption" : "Group 34",
                    "from" : 2,
                    "to" : 3,
                    "colResizer" : true
                }])
                );
            
            return children;
            // ]]Code created by CrossUI RAD Studio
        }
    }
});
   
Attachments
Untitled.png
Untitled.png (2.24 KiB) Viewed 10304 times

Locked