Telegram_2020-04-20T11

<< Click to Display Table of Contents >>

Navigation:  Telegram > 2020 > 04 > 20 >

Telegram_2020-04-20T11

Telegram link

 

2020-04-20T11:11:45

 

long time since my last comment

 

i noticed that adjusting components TabOrder in IW is compicated and time consuming.

 

so i make this function in javascript that adjust elements TabOrder according to its position in page

 

and wanted to share this experience

 


 

Telegram link

 

2020-04-20T11:12:06

 

var gTabIndex = 0;

 

function AdjustTabIndexes(xParent) {

 

var i;

 

var itemsArr = xParent.OwnedComps;

 

itemsArr.sort(function(a, b) {

 

return a.offsetTop == b.offsetTop

 

? (a.offsetLeft > b.offsetLeft ? 1 : -1)

 

: (a.offsetTop > b.offsetTop ? 1 : -1);

 

});

 

for (i = 0; i < itemsArr.length; ++i) {

 

//if (itemsArr[i].hasAttribute(\tabindex\)) {

 

if (itemsArr[i].getAttribute(\tabindex\) > 0) {

 

console.log(itemsArr[i].id);

 

gTabIndex++;

 

itemsArr[i].setAttribute(\tabindex\, gTabIndex);

 

}

 

//}

 

AdjustTabIndexes(itemsArr[i]);

 

}

 

}

 


 

Telegram link

 

2020-04-20T11:12:39

 

any helpfull comments are appreciated