I’ve had a view problems with my v. of the libs since the last update:
layout.cells(“a”).view(“form”).setActive() No longer works as before … In some places I got round it by actually giving the “def” view a different name.
it use to work as follows:
form1 = layout.cells(“a”).attachForm(cfgForm1);
form2 = layout.cells(“a”).view(“form2”).attachForm(cfgForm2);
and you could switch between:
layout.cells(“a”).view(“def”).setActive()
layout.cells(“a”).view(“form2”).setActive()
form.setReadonly(“inputbox”,true) … now fails
previously documented changes in handling of buttons
etc…
Am I doing something wrong or was that a “broken” update ?
Following up on my comments above, please find attached example of “setActive” not working…
If you click on the plus sign, it should execute the code starting at line 112 (gRid = -1)
at line 116 it should bring up the
emailLayout.cells(“a”).view(“dstEdit”)
view which should show the “emailForm” form
The form exists; I’ve debugged and found values for fields in form like
emailForm.getItemValue(‘dTipo’)
But it just does NOT appear in the Layout!
readOnly. I have a form that displays order details. If the order has been sent then the data must no longer be editable. So, according to this, I have to user form.setReadonly(“inputBox”)
on each “inputbox” on the form
By (3) I mean viewtopic.php?f=14&t=25642&start=0
The syntax for handling button events on forms changed and it drove me CRAZY for 3 days!
Place the next toolber event handler (replace with yours):
emailToolbar.attachEvent("onClick", function(id) {
if(id == "tNew"){emailLayout.cells("a").view("dstEdit").setActive();}
else if (id == "tDel"){emailLayout.cells("a").view("def").setActive();}
});
2) Wait for an answer, pleace
3) Yes, attribute “command” doesn’t exist any more. Use:
myForm.attachEvent("onButtonClick", function(name,command){
if (name == "btn"){ ...code...}
});
Ok Darya,
I’ve solved the problem and IT IS a BUG!
You’re example doesn’t work either, even with the libraries downloaded today. I’ll explain:
When the window had finished loading, it is displaying the default view, right?
BUT, if, from you’re example, you try to select the alternate layout (the green button), it doen’t work. you have to FIRST select the red button, in practice setting active the default view, even though it is already active!!
So even to make your code work properly, you have to add
emailLayout.cells(“a”).view(“def”).setActive();
to the end of the code, before clicking any buttons !
Try your example, try ONLY clicking the green PLUS … you will see it will NOT work until you first click the RED button, setting active the view that is ALREADY active!!!
problem was with form, when it attached to layout’s cell active view was automaticaly switched to form’s view, that’s why you need to click to show grid view before form. dhtmlx.js above fixed.