treegrid hotrow

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

treegrid hotrow

Postby tomy300 » Mon May 26, 2014 7:11 pm

Hi again

I tried the sample on orderManager and try to reproduce hotrow but does't work, ordermanager update row on database or delete it but I want it more simple than that, I want an empty grid
and people can add row on the fly and click a button save to save the data on the grid in a database.

but I don't understand how hotrow work it's not pretty clear and not much explanation in the API or example on this.

here example,
http://awesomescreenshot.com/04d2v9zzd0
tomy300
 
Posts: 70
Joined: Sat Nov 09, 2013 12:27 am

Re: treegrid hotrow

Postby support » Wed May 28, 2014 1:35 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.Pane())
.setHost(host,"ctl_pane6")
.setLeft(30)
.setTop(20)
.setWidth(180)
.setHeight(220)
);

host.ctl_pane6.append((new xui.UI.TreeGrid())
.setHost(host,"ctl_treegrid2")
.setRowNumbered(true)
.setEditable(true)
.setHeader([{"id":"col1", "caption":"col1", "width":80, "type":"input"}])
.setTreeMode(false)
.setHotRowMode("show")
.beforeHotRowAdded("_ctl_treegrid2_beforehotrowadded")
);

append((new xui.UI.SButton())
.setHost(host,"ctl_sbutton7")
.setLeft(70)
.setTop(260)
.setWidth(90)
.setCaption("Get Data")
.onClick("_ctl_sbutton7_onclick")
);

return children;
// ]]Code created by CrossUI RAD Tools
},
// To determine whether to add this row or not
_ctl_treegrid2_beforehotrowadded:function (profile, row, leaveGrid){
if(_.get(row,["cells","0","value","length"])){
return true;
}else{
return false;
}
},
_ctl_sbutton7_onclick:function (profile, e, src, value){
var ns = this,
data = ns.ctl_treegrid2.getRows("min");
xui.echo(data);
}
}
});
   
support
 
Posts: 351
Joined: Sat Apr 27, 2013 9:22 am

Re: treegrid hotrow

Postby tomy300 » Wed May 28, 2014 3:38 am

thanks it's working :)
tomy300
 
Posts: 70
Joined: Sat Nov 09, 2013 12:27 am

Re: treegrid hotrow

Postby tomy300 » Wed May 28, 2014 4:37 pm

Hi again

I try to hotrow on keyup return and add this row instead of click somewhere to make the hotrow add it , my code does't seem to work.


I just want to add a new line when I keypress "return"

Code: Select all
        _ctl_treegrid2_onhotkeyup:function (profile,keyboard,e,src){
            var ns = this, uictrl = profile.boxing();
   
            if(keyboard == "enter,,,"){
              row = ns.ctl_treegrid2.getActiveRow(); 
              ns.ctl_treegrid2.setActiveRow(row.id);

            }
           
        }

tomy300
 
Posts: 70
Joined: Sat Nov 09, 2013 12:27 am

Re: treegrid hotrow

Postby support » Thu May 29, 2014 12:39 am

You should learn to debug your code.
Monitor the "keyboard" please.
support
 
Posts: 351
Joined: Sat Apr 27, 2013 9:22 am


Return to CrossUI for Desktop Apps

Who is online

Users browsing this forum: No registered users and 0 guests

cron