:: Forum >>

getElementById for CheckedList?

Hello,

I want to get the selected Items of a CheckedList. I create the CheckedLists dynamically:

for (var i = 2; i < trSettingName.cells.length; i++) {
[...]
var checkedList = new AW.UI.CheckedList;
checkedList.setId('cmbDimension_ID' + i);
checkedList.setItemText(arrItemText);
checkedList.refresh();
}


How can I get the CheckedList object with something like the getElementById function, e.g.:

var checkedList = document.getElementById('cmbDimension_ID' + i);

alert(checkedList.getSelectedRows());


or something else

var checkedList = new AW.UI.CheckedList;
checkedList.getElementById('cmbDimension_ID' + i);
Alex
Friday, May 29, 2015
I found the solution by myself on http://www.activewidgets.com/javascript.forum.10734.9/getting-dynamically-created-grid-object.html

Maybe someone helps:

version 1

var obj = Active.System.all['mygrid']
Version 2
var obj = AW.object(id);
bad way:
x = eval('mygrid')
theIndex = x.getSelectedIndex();
theId = x.getId();


getting the selected Item texts:
var ComboBox = AW.object('cmbDimension_ID' + intDimension_ID);
var SelItems = ComboBox.getSelectedItems();

[...]
for (var intSelItems = 0; intSelItems < SelItems.length; intSelItems++) {
objCriteria.Values.push("'" + ComboBox.getItemValue(SelItems[intSelItems]) + "'");
}


I really like the activewidgets and this Forum. It's very helpful!
Alex
Friday, May 29, 2015

This topic is archived.


Back to support forum

Forum search