var invoiceOpts = Array(
Array('preview_invoice', 'obj', 'Preview Invoice', 'iconNew_dis.gif', 'iconNew_dis.gif'),
Array('send_invoice', 'obj', 'Send Invoice Email', 'Email_go.png', 'Email_go.png'),
Array('testing1', 'obj', 'Testing 1', 'Email_go.png', 'Email_go.png'),
Array('testing2', 'obj', 'Testing 2', 'Email_go.png', 'Email_go.png')
);
toolbar.addButtonSelect("print_invoice", 9, "Print Invoice", invoiceOpts, "print.gif", "print_dis.gif");
I would like to do two things:
1. Set up select item after click on buttonSelect
2. Call different application according to selected item from buttonSelect
3. the option list no change before/after clicking the selectButton or its option list.
the onclick callback function below
toolbar.attachEvent("onClick",function(itemId){
switch (itemId) {
case "print_invoice":
// attach URL to send email invoice into Panel b
dhxLayout.cells("b").attachURL("dispatch.php?show_type=print_invoice&id=1234567&start_date=2009-09-01&end_date=2010-01-01&due_date=2010-01-16");
break;
case "preview_invoice":
// attach URL to send email invoice into Panel b
dhxLayout.cells("b").attachURL("dispatch.php?show_type=preview_invoice&id=1234567&start_date=2009-09-01&end_date=2010-01-01&due_date=2010-01-16");
break;
case "send_invoice":
// attach URL to send email invoice into Panel b
dhxLayout.cells("b").attachURL("dispatch.php?show_type=send_invoice&id=1234567&start_date=2009-09-01&end_date=2010-01-01&due_date=2010-01-16");
break;
case "testing1":
// attach URL to send email invoice into Panel b
dhxLayout.cells("b").attachURL("http://www.google.com");
break;
case "testing2":
// attaching an object to Panel a
dhxLayout.cells("a").attachObject("objId");
break;
}
});
The problem I encountered as below,
I try to use the following code to set up selected item, toolbar.getItem(itemId).setSelected(true);
it does not work.
After clicking on Testing 1, Testing 2, Send Invoice Email, buttonSelect option list are not changed, but after clicking on Print Invoice, Preview Invoice, the buttonSelect option list was left only Print Invoice.
[Note]
Print Invoice, Preview Invoice generate PDF file.
I guess the PDF header cause the problem, but I do not know how to solve it.
The second problem is kind of being solved. I open a new window for two generating PDF list options - print_invoice, preview_invoice. The list option would appear after the user click these two options. But the second opening window header title disappears however I adjust the window position.
Another problem is that the content of the same panel can not be changed after I attached the object, for example a
the content of the same panel can not be changed after I attached the object
You can set attachObject method again to place the object into the panel. The previous content will be removed in this case. To preserve it you may try to use detachObject method: