<script>
var tooltip = new ej.popups.Tooltip({
// default content of tooltip
content: 'Loading...',
// set target element to tooltip
target: '.e-list-item',
// set position of tooltip
position: 'top center',
// bind beforeRender event
beforeRender: onBeforeRender
});
tooltip.appendTo('body');
function onBeforeRender(args) {
// get the target element
var listElement = document.getElementById('messageid');
var result = listElement.ej2_instances[0].dataSource;
var i;
for (i = 0; i < result.length; i++) {
if (result[i].Name === args.target.textContent) {
this.content = result[i].Name;
this.dataBind();
break;
}
}
}
</script> |
<ejs-combobox id="messageid" dataSource="@ViewBag.data" ejs-for="Value" cssClass="e-custom-class" placeholder="Select a Message">
<e-combobox-fields text="Name" value="Code"></e-combobox-fields>
</ejs-combobox>
<script>
var tooltip = new ej.popups.Tooltip({
// default content of tooltip
content: 'Loading...',
// set target element to tooltip
target: '.e-custom-class .e-list-item',
// set position of tooltip
position: 'top center',
// bind beforeRender event
beforeRender: onBeforeRender
});
tooltip.appendTo('body');
function onBeforeRender(args) {
// get the target element
var listElement = document.getElementById('messageid');
var result = listElement.ej2_instances[0].dataSource;
var i;
for (i = 0; i < result.length; i++) {
if (result[i].Name === args.target.textContent) {
this.content = result[i].Name;
this.dataBind();
break;
}
}
}
</script> |