Adjust value to date string for date-type ComboInput

Find code here before you post.

Adjust value to date string for date-type ComboInput

Postby linb » Wed Jun 05, 2013 11:51 am

Original post : get-the-value-of-a-comboinput-type-date-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[i] = xui.Date.format(o,"mm-dd-yyyy");
});
}
}
});
   
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 1 guest

cron