Hello
Problem is, When registering new user, i have to type 4-5 letters because sorting in combo box is something like following (it is not sort alphabetically)
Idea
Icarus
Iphone
so, i have delete D letter for selecting Icarus…
I have changed my code, and it works perfect for now, however this time when user want to update grid same combo box returns empty instead of selected user name shows in Combo already.
This is my code and i could not find any solution for 3 days.
[code]Form : function(rowId)
{
GetDate = App.GetDate();
if(typeof(FFW)=='undefined'){
FFW = App.Window('Payment Form',505,250);
FFW.attachEvent("onClose",function(){ delete FFW; return true; });
FFW.progressOn();
}
FinanceUpdateForm = FFW.attachForm();
formData = [
{"type":"settings","position":"label-top","inputWidth":470,"labelAlign":"left"},
{"type":"block","width":470,"blockOffset":10,"list":[
{"type":"block","width":470,"blockOffset":0,"offsetLeft":0,"className":"noMargin","list":[
{"type":"combo","name":"user_id","label":"User","inputWidth":310,"connector":"get/current/all?list-1&return=xml", "filtering":true},
//{"type":"combo","name":"user_id","label":"User","inputWidth":310,"offsetLeft":0},
{"type":"newcolumn"},
{"type":"combo","name":"kategori_id","label":"Categori","inputWidth":145,"offsetLeft":10,"connector":"/get/finance/cats?list=1&return=xml","filtering":true}
]},
{"type":"block","width":470,"blockOffset":0,"offsetLeft":0,"className":"noMargin","list":[
{"type":"combo","name":"itype","label":"Type","required":true,"options":[{"value":"1","text":"Choose One"},{"value":"2","text":"Payment"},{"value":"3","text":"Pending"}],"inputWidth":100},
{"type":"newcolumn"},
{"type":"input","name":"total","label":"Total","required":true,"inputWidth":110,"numberFormat":"0,000.00","offsetLeft":10},
{"type":"newcolumn"},
{"type":"combo","name":"currency","label":"Currency","inputWidth":80,"offsetLeft":10,"options":[{"value":"1","text":"GBP"},{"value":"2","text":"EURO"},{"value":"3","text":"DOLAR"}]},
{"type":"newcolumn"},
{"type":"calendar","name":"regdate","label":"Date","inputWidth":145,"offsetLeft":10,"readonly":true,"dateFormat":"%Y.%m.%d","value":GetDate['year']+'.'+GetDate['month']+'.'+GetDate['day']}
]},
{"type":"input","name":"remarks","label":"Remarks","width":465},
{"type":"hidden","name":"finance_id"},
{"type":"button","name":"send","value":"Save"}
]}
];
FinanceUpdateForm.loadStruct(formData,"json");
FinanceUpdateForm.getCombo('user_id').enableFilteringMode(true, "/get/current/all?list=1&return=xml");
FinanceUpdateForm.getCombo('user_id').disableAutocomplete();
FinanceUpdateForm.attachEvent("onButtonClick",function(id){
if(id=="send")
{
FFW.progressOn();
FinanceUpdateForm.send("/api/finance/save", function(loader, response){
FFW.progressOff();
json_res = JSON.parse(response);
if(json_res['status']=='ERROR')
dhtmlx.alert({ title:"Warning",type:"alert-error",text:json_res['error_message'] });
else if(json_res['status']=='OK')
{
dhtmlx.message({text: "Data saved..." });
FFW.close();
App.Finance.List();
}
});
}
});
if(rowId!='')
FinanceUpdateForm.load('/api/finance/info?finans_id='+rowId,function(){ FFW.progressOff(); });
else
FFW.progressOff();
[/code]