toPdf with multirows header

Hi Everybody

I’m using Version 5 of Suite and i’ve a problem with toPDF function.

It seem reproduce all correctly apart two problems:

  • It doesn’t consider setColVAlign. i set “middle” for all columns but thre result is always top.
  • It doesn’t consider multirows Headers. What i define in setHeader is correctly reproduced while what define in attachHeader is not reproduced.

Some ideas ? Can you help me ?

Unfortunately the vertical align is not applying in the exported pdf

Unfortunately I was not able to reproduce your issue locally. The following snippet seems to export correctly:
http://snippet.dhtmlx.com/5/216f27368
If the problem still occurs for you pleas,e provide a complete demo or a code snippet where the problem can be reproduced.

Thank you Sematik.

Another strange behaviour that i have to correct.

i’ ve an an accordion with 2 cells. Both cells contain a different form. The strange behaviour is that clicking the tab key on the fields in first cell form, it switch between the various fields but when in arrives to the last field, instead to return to the first field (cycling in the same form) it passed on the first fields of the second cells form even if it’s closed misaligning all the accordion layout.

How can i solve ?
Thanks

This is an expected behavior.
You may prevent the form from losing its focus from the onKeyDown event and set a needed element’s focus by the setItemFocus() method from the onBlur event.
Something like:
http://snippet.dhtmlx.com/5/74950e2dd

Many thanks Sematik but now i’ve to catch the Shift+Tab Key to armour the form.

i try with if(ev.key == “Shift” && ev.key == “Tab” && name == “codice”) but in doesn’t seem to run. Is there a trick ?

Thanks

You need to check the ev.shiftKey property in this case, not ev.key:

Here is the updated example:
http://snippet.dhtmlx.com/5/e2efe9cae

Thank you Sematik. I followed the Snippet but there is again a problem.

i’ve this form:

<?xml version="1.0"?>

How you can see there are two combos and the problem seems to be there.

This is my code following the snippet:

var loop_tab=0;
magForm.attachEvent(“onBlur”, function(name){
if (name == “nota” && loop_tab==1){
loop_tab=0;
if (magForm.isItemEnabled(“codice”) === true) {
setTimeout(function(){magForm.setItemFocus(“codice”)},15);
}else{
setTimeout(function(){magForm.setItemFocus(“descrizione”)},15);
}
}
if (name == “descrizione” && loop_tab==1){
loop_tab=0;
if (magForm.isItemEnabled(“codice”)) {
setTimeout(function(){magForm.setItemFocus(“codice”)},15);
}else{
setTimeout(function(){magForm.setItemFocus(“nota”)},15);
}
}
});

magForm.attachEvent(“onKeyDown”,function(inp, ev, name, value){
if(name == “nota” && ev.key == “Tab” && !ev.shiftKey){
loop_tab=1;
if (magForm.isItemEnabled(“codice”) === true) {
magForm.setItemFocus(“codice”);
}else{
magForm.setItemFocus(“descrizione”);
}
}
if(name == “descrizione” && ev.key == “Tab” && ev.shiftKey){
loop_tab=1;
if (magForm.isItemEnabled(“codice”) === true) {
magForm.setItemFocus(“codice”);
}else{
magForm.setItemFocus(“nota”);
}
}
});

The problem is that the first time i focus on the form on field “descrizione” pushing TAB the focus passes to UM (combo) but remains there or better seems to exit from the form passing on a grid. If instead i click on Catergoria (combo) then pushing tab it continue to cicle correctly between all the fields. I don’t understand where is the problem. Can you help me ?

I tried in some ways and it seems that onkeydown event never happens when tab is pressed on a combo. Is it a bug ?

Many thanks.

Hi Sematik.

I tried to modify the snippet too.

http://snippet.dhtmlx.com/5/bf0d587e6

I changed the layout, more similar to my layout, and transformed the two inputs in two combos. If you try to use Shift-Tab you’ll realize that arrived to the first fields (name) it won’t return to the last fields.

Please Help.

Bye

Unfortunately in case of a combo control the form onKeyDown event is not triggering and you need to use the events of the dhtmlxCombo:
https://docs.dhtmlx.com/api__refs__dhtmlxcombo_events.html
There is no possibility to control the form focus in this case.