Adjust value to date string for date-type ComboInput

Find code here before you post.
Locked
linb
Site Admin
Posts: 102
Joined: Thu Apr 25, 2013 6:51 am

Adjust value to date string for date-type ComboInput

Post by linb »

Original post : http://www.crossui.com/Forum/get-the-va ... e-t97.html
   
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.DataBinder)
                .setHost(host,"databinder_1")
                .setName("databinder_1")
                .afterUpdateDataFromUI("_databinder_1_afterupdatedatafromui")
            );
            
            append(
                (new xui.UI.ComboInput)
                .setHost(host,"ctl_comboinput25")
                .setDataBinder("databinder_1")
                .setDataField("date")
                .setLeft(90)
                .setTop(30)
                .setType("date")
                .setValue("1370016000000")
            );
            
            append(
                (new xui.UI.SButton)
                .setHost(host,"ctl_sbutton19")
                .setLeft(90)
                .setTop(90)
                .setWidth(120)
                .setCaption("Get Date Value")
                .onClick("_ctl_sbutton19_onclick")
            );
            
            return children;
            // ]]Code created by CrossUI RAD Tools
        },
        _ctl_sbutton19_onclick : function (profile, e, src, value){
            xui.alert(_.serialize(this.databinder_1.updateDataFromUI().getData()));
        },
        _databinder_1_afterupdatedatafromui : function (profile, dataFromUI){
            _.each(dataFromUI,function(o,i){
                if(_.isDate(o))
                    dataFromUI = xui.Date.format(o,"mm-dd-yyyy");
            });
        }
    }
});
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.DataBinder)
                .setHost(host,"databinder_1")
                .setName("databinder_1")
                .afterUpdateDataFromUI("_databinder_1_afterupdatedatafromui")
            );
            
            append(
                (new xui.UI.ComboInput)
                .setHost(host,"ctl_comboinput25")
                .setDataBinder("databinder_1")
                .setDataField("date")
                .setLeft(90)
                .setTop(30)
                .setType("date")
                .setValue("1370016000000")
            );
            
            append(
                (new xui.UI.SButton)
                .setHost(host,"ctl_sbutton19")
                .setLeft(90)
                .setTop(90)
                .setWidth(120)
                .setCaption("Get Date Value")
                .onClick("_ctl_sbutton19_onclick")
            );
            
            return children;
            // ]]Code created by CrossUI RAD Tools
        },
        _ctl_sbutton19_onclick : function (profile, e, src, value){
            xui.alert(_.serialize(this.databinder_1.updateDataFromUI().getData()));
        },
        _databinder_1_afterupdatedatafromui : function (profile, dataFromUI){
            _.each(dataFromUI,function(o,i){
                if(_.isDate(o))
                    dataFromUI = xui.Date.format(o,"mm-dd-yyyy");
            });
        }
    }
});
   

Locked