841kks
#1
Hi all.
Please, help.
SCRIPT:
var win = dhxWins.createWindow(“sms_send”, 0, 0, 700, 380);
win.setText(“СМС рассылка”);
win.setModal(true);
var layout = win.attachLayout(“2U”);
layout.cells(“a”).setText(“Some text”);
layout.setCollapsedText(“a”, “”);
layout.cells(“b”).setText(“Some text”);
layout.setCollapsedText(“b”, “”);
layout.cells(“a”).setWidth(340);
var form = layout.cells(“a”).attachForm();
form.loadStruct(“common/form_sms.xml”);
form.attachEvent(“onButtonClick”, function(){
form.SetItemValue(“phone”, “NEW INPUT VALUE”); - PROBLEMS HERE!!!
check(false);
//win.close();
});
When I press the button occurs of nothing, in the field of input “phone” there is no text.
What do I do incorrectly? Please? help!!!
Change you code as
form.loadStruct("common/form_sms.xml", function(){
form.attachEvent("onButtonClick", function(){
form.SetItemValue("phone", "NEW INPUT VALUE");
});
loading is async
841kks
#4
Stanislav, Unfortunately, it hasn’t helped to solve a problem, doesn’t work.
Please help!
I don’t understand, in what a problem
var form = layout.cells(“a”).attachForm();
form.loadStruct(“common/form_sms.xml”, function(){
form.attachEvent(“onBeforeChange”, function(id, old_value, new_value) {
alert(id + " oldvalue= " + old_value + " newvalue= " + new_value);
return true;
});
form.attachEvent(“onButtonClick”, function(){
form.SetItemValue(“phone”, “SOME NEW VALUE”);
});
});
841kks
#5
Problem with installation of the text in the field of input, in two different places, please help! See code in file.
The correct name of method is setItemValue - case is matter
docs.dhtmlx.com/doku.php?id=dhtm … titemvalue
841kks
#8
Stanislav, thanks a lot.
Now, all works.