Причины такого странного поведения были найдены.
//> @method formItem.getSelectionRange()
// For text-based items, this method returns the indices of the start/end of the current
// selection. Returns null if the item doesn't have focus.
// <P>
// Notes:
// <UL>
// <LI>In Internet Explorer, if the item has lost focus since the selection was made,
// only the start (current caret position) is returned. This is a limitation of Internet
// Explorer.</LI>
// If the item doesn't have focus always return null
// Natively the method we use in Moz would give us back the last selection, but the
// method we use in IE can't give us anything meaningful.
Взято из FormItem.js
Итак, после того, как сервер вернул нам часть данных (событие dataArrived), данные, извлеченные в ListGrid
и TextField
, потеряли фокус. Когда мы вручную помещаем фокус обратно в текстовое поле (form.focusInItem(item);
), выбор будет (0,0) - начало поля. Но только в IE. Таким образом, мы должны сохранить последний выбор перед извлечением данных, а затем применить этот выбор после того, как фокус был вручную возвращен в текстовое поле.
И после всех операций с данными и перед тем, как поставить фокус и выбрать настройки, мы должны сделать form.redraw();