my code stop working

Develop and Deploy Cross-Browser Web Apps .

my code stop working

Postby tomy300 » Mon Dec 02, 2013 1:31 am

Hi ....

my code stop working and there's no error mark in this code ....so I wonder what's wrong. In Example page there a
"Variable Monitor" how to activate it ? this should be activate in debug mode by defaut.


Code: Select all
// 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
            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.MenuBar())
            .setHost(host,"ctl_menubar5")
            .setItems([{"id":"menu1", "sub":[{"id":"normal", "caption":"normal"}, {"id":"disabled", "caption":"disabled", "disabled":true}, {"id":"image", "caption":"image", "image":"img/demo.gif"}, {"type":"split"}, {"id":"checkbox 1", "caption":"checkbox 1", "type":"checkbox"}, {"id":"checkbox 2", "caption":"checkbox 2", "type":"checkbox"}], "caption":"Fichier"}, {"id":"menu2", "sub":[{"id":"sub menu 1", "caption":"sub menu 1", "add":"[Ctrl+F]", "sub":[{"id":"sub 1", "type":"radiobox"}, {"id":"sub 2", "type":"radiobox"}, {"id":"sub 3"}]}, {"id":"sub menu 2", "caption":"sub menu 2", "add":"[Ctrl+T]", "sub":["sub 3", "sub 4"]}], "caption":"menu2"}])
            );
           
            append((new xui.UI.ToolBar())
            .setHost(host,"ctl_toolbar18")
            .setItems([{"id":"toolSection1", "sub":[{"id":"toolNewMail", "caption":"New Mail", "tips":"New Mail Message", "image":"{/}img/allinone.gif", "imagePos":"-80px top"}], "caption":"toolSection1"}, {"id":"toolSection2", "sub":[{"id":"toolPrint", "tips":"print", "image":"{/}img/allinone.gif", "imagePos":"top left", "caption":""}, {"id":"toolMove", "tips":"Move to folder", "image":"{/}img/allinone.gif", "imagePos":"-64px top", "caption":""}, {"id":"toolDelete", "tips":"Delete", "image":"{/}img/allinone.gif", "imagePos":"-224px top", "caption":""}], "caption":"toolSection2"}, {"id":"toolSection3", "sub":[{"id":"toolReply", "tips":"reply", "caption":"Reply", "image":"{/}img/allinone.gif", "imagePos":"-160px top"}, {"id":"toolReplyAll", "tips":"Reply to all", "caption":"Reply to All", "image":"{/}img/allinone.gif", "imagePos":"-176px top"}, {"id":"toolForward", "tips":"Forward", "caption":"Forward", "image":"{/}img/allinone.gif", "imagePos":"-112px top"}, {"id":"toolRendReceive", "tips":"Rend / Receive", "caption":"Rend/Receive", "image":"{/}img/allinone.gif", "imagePos":"-192px top"}], "caption":"toolSection3"}])
            );
           
            append((new xui.UI.Layout())
            .setHost(host,"ctl_layout30")
            .setItems([{"id":"before", "pos":"before", "min":50, "size":250, "locked":false, "folded":false, "hidden":false, "cmd":true}, {"id":"main", "min":10}])
            .setType("horizontal")
            );
           
            host.ctl_layout30.append((new xui.UI.ButtonViews())
            .setHost(host,"ctl_buttonviews15")
            .setItems([{"id":"idsoumission", "image":"{/}img/allinone.gif", "imagePos":"-80px top", "tips":"Soumission", "caption":"Soumission"}, {"id":"idfacture", "image":"{/}img/allinone.gif", "imagePos":"-96px top", "tips":"Facturation", "caption":"Facture"}, {"id":"contact", "image":"{/}img/allinone.gif", "imagePos":"-48px top", "tips":"Contact", "caption":"contact"}])
            .setBarSize(28)
            .setValue("idsoumission")
            , "before");
           
            host.ctl_buttonviews15.append((new xui.UI.Panel())
            .setHost(host,"pan_soumission")
            .setZIndex(1)
            .setCaption("Soumission")
            .setCustomStyle({"KEY":{"$gradients":""}})
            , "idsoumission");
           
            host.pan_soumission.append((new xui.UI.SButton())
            .setHost(host,"ctl_sbutton275")
            .setLeft(25)
            .setTop(40)
            .setWidth(160)
            .setCaption("Modifier une soumission")
            );
           
            host.ctl_buttonviews15.append((new xui.UI.SButton())
            .setHost(host,"btn_soumission")
            .setLeft(30)
            .setTop(40)
            .setWidth(160)
            .setCaption("Crée une soumission")
            .onClick("_btn_soumission_onclick")
            , "idsoumission");
           
            host.ctl_layout30.append((new xui.UI.Block())
            .setHost(host,"blc_soumission")
            .setDock("fill")
            .setZIndex(0)
            .setVisibility("hidden")
            .setCustomStyle({"KEY":{"$gradients":""}})
            , "main");
           
            host.blc_soumission.append((new xui.UI.SLabel())
            .setHost(host,"ctl_slabel70")
            .setDock("origin")
            .setLeft(170)
            .setTop(190)
            .setCaption("Soumission")
            .setCustomStyle({"KEY":{"font-size":"34pt", "$gradients":""}})
            );
           
            host.blc_soumission.append((new xui.UI.Block())
            .setHost(host,"blc_addsoumission")
            .setDock("fill")
            .setVisibility("visible")
            );
           
            host.blc_addsoumission.append((new xui.UI.TreeGrid())
            .setHost(host,"grid_soumission")
            .setDock("width")
            .setEditable(true)
            .setRowHandler(false)
            .setHeader([{"id":"idid", "type":"label", "width":40, "caption":"id"}, {"id":"idnom", "type":"combobox", "width":180, "caption":"Nom"}, {"id":"iddesc", "type":"combobox", "width":80, "caption":"Description"}, {"id":"idprice", "type":"currency", "width":80, "caption":"Prix"}, {"id":"idqte", "type":"number", "width":80, "caption":"Qte"}, {"id":"idtotal", "type":"currency", "width":80, "caption":"Total"}])
            .afterUIValueSet("_grid_soumission_afteruivalueset")
            .onRender("_grid_soumission_onrender")
            .afterRowActive("_grid_soumission_afterrowactive")
            .afterCellUpdated("_grid_soumission_aftercellupdated")
            );
           
            host.blc_addsoumission.append((new xui.UI.SButton())
            .setHost(host,"btn_addinvoice")
            .setLeft(20)
            .setTop(210)
            .setWidth(120)
            .setCaption("Ajout d'une entrer")
            .onClick("_btn_addinvoice_onclick")
            );
           
            host.blc_addsoumission.append((new xui.UI.Div())
            .setHost(host,"div6")
            .setLeft(250)
            .setTop(320)
            .setWidth(100)
            .setHeight(20)
            );
           
            host.blc_addsoumission.append((new xui.UI.Input())
            .setHost(host,"txt1")
            .setLeft(180)
            .setTop(210)
            );
           
            return children;
            // ]]Code created by CrossUI RAD Tools
        },
        // Give a chance to load other com
        iniExComs : function(com, threadid){
            window.selectedrow = "";
        },
        // 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 : {"onRender":"_com_onrender"},
        _ctl_image2_onclick:function (profile,e,src){
            var ns = this, uictrl = profile.boxing();
        },
        _btn_soumission_onclick:function (profile,e,src,value){
            var ns = this, uictrl = profile.boxing();
            this.blc_addsoumission.setVisibility('visible');
           
        },
        _btn_addinvoice_onclick:function (profile,e,src,value){
            var ns = this, uictrl = profile.boxing();
            var hhh=[{"cells":[{"caption":"1"},{"caption":"Nom du produit ou service"},{"caption":"Description"},{"caption":"0"},{"caption":"1","value":"1"},{"caption":"0","value":"0"}]}];
            this.grid_soumission.insertRows(hhh,null,null,false);
        },
        _grid_soumission_aftercellupdated:function (profile,cell,options,isHotRow){
            var ns = this, m = profile.boxing();
            //var rows=this.grid_soumission.getRows();
            //var iPrice = cell.value;
            //var therow = window.selectedrow;
            //var iQte = therow.cells[4].value;
            //var iTotal = iPrice * iQte;

                 
        },
        _grid_soumission_onrender:function (profile){
            var ns = this, uictrl = profile.boxing();
            this.grid_soumission.setAltRowsBg( !this.grid_soumission.getAltRowsBg());
            this.div6.setRenderer(value,force)(this.grid_soumission.getAltRowsBg());
        },
        _grid_soumission_afterrowactive:function (profile,row){
            var ns = this, uictrl = profile.boxing();
            window.selectedrow = row;
        },
        _com_onrender:function (com,threadid){
           
        }
    }
});
tomy300
 
Posts: 70
Joined: Sat Nov 09, 2013 12:27 am

Re: my code stop working

Postby tomy300 » Mon Dec 02, 2013 3:57 am

I found the problem, this code make hang the program. the div6 is there I take this code from the example.

Code: Select all
        _grid_soumission_onrender:function (profile){
            var ns = this, uictrl = profile.boxing();
            this.grid_soumission.setAltRowsBg( !this.grid_soumission.getAltRowsBg());
            this.div6.setRenderer(value,force)(this.grid_soumission.getAltRowsBg());
        },
tomy300
 
Posts: 70
Joined: Sat Nov 09, 2013 12:27 am


Return to CrossUI for Web Apps

Who is online

Users browsing this forum: No registered users and 2 guests

cron