getItemIdsTop
array getItemIds()
Get all ids of items in combobox
Show/Hide Code
<script type="text/javascript">
function foo()
{
// Get all items' id.
var itemIdList = kac.getItemIds();
var oItem = kac.getItem(itemIdList[0]);
oItem.select();
}
</script>
Supported from version: 1.0.0.1
getItemTop
KoolcomboboxItem getItem(string itemid)
Get item object
Show/Hide Code
<script type="text/javascript">
function foo()
{
//Select the first item of combobox
var oItem = kac.getItem(kac.getItemIds()[0]);
oItem.select();
}
</script>
Supported from version: 1.0.0.1
addItemTop
KoolcomboboxItem addItem(string text, [object data])
Add a new item to item list of combobox
Show/Hide Code
<script type="text/javascript">
function foo()
{
// Add new item.
kac.addItem("I am new",{"image":"new.gif"});
}
</script>
Supported from version: 1.0.0.1
removeItemTop
void removeItem(string itemid)
Remove item from item list of combobox
Show/Hide Code
<script type="text/javascript">
function foo()
{
//Remove the first item of the item
var itemIdList = kac.getItemIds();
kac.removeItem(itemIdList[0]);
}
</script>
Supported from version: 1.0.0.0
getTextTop
string getText(string id)
Get selected text in combobox
Show/Hide Code
<script type="text/javascript">
function foo()
{
// Alert the selected text.
alert(kcb.getText());
}
</script>
Supported from version: 1.0.0.0
getValueTop
string getValue(string id)
Get selected value in combobox
Show/Hide Code
<script type="text/javascript">
function foo()
{
// Alert the selected value.
alert(kcb.getValue());
}
</script>
Supported from version: 1.0.0.0
openTop
void open(string id)
Open combobox option panel
Show/Hide Code
<script type="text/javascript">
function foo()
{
// Open the option panel.
kac.open();
}
</script>
Supported from version: 1.0.0.0
isOpeningTop
bool isOpening(string id)
Return true if combobox option panel is opening
Show/Hide Code
<script type="text/javascript">
function foo()
{
// Alert whether option panel is opened.
alert(kac.isOpening()?"Open":"Close");
}
</script>
Supported from version: 1.0.0.0
closeTop
string close(string id)
Close combobox option panel
Show/Hide Code
<script type="text/javascript">
function foo()
{
// Close the option panel.
kac.close();
}
</script>
Supported from version: 1.0.0.0
registerEventTop
void registerEvent(string eventName, function handleEvent)
Register an client-side event.
Allowed eventName:
"OnBeforeSelect"
"OnBeforeOpen"
"OnBeforeClose"
"OnBeforeSendUpdateRequest"
"OnBeforeUpdateItemList"
"OnBeforeKeyPress"
"OnSelect"
"OnOpen"
"OnClose"
"OnSendUpdateRequest"
"OnUpdateItemList"
"OnKeyPress"
Show/Hide Code
<script type="text/javascript">
function itemSelect_handle(sender,arg)
{
alert(arg.ItemId);
}
// Register for OnSelect event
ksm.registerEvent("OnSelect",itemSelect_handle);
</script>
Supported from version: 1.0.0.0