Dependent dropdown example
Dependent dropdown example
Here is an example of the use of dependent drop down with country - state example
[code]
$('select', editor.node('country')).on('change', function () {
fnGetStateList(editor.get('country'))
});
editor.on('onInitCreate onInitEdit', function () {
editor.add({
"label": "State:",
"name": "state",
"type": "select"
});
editor.add({
"label": "Country:",
"name": "country",
"type": "select"
});
fnGetCountryList();
fnGetStateList(editor.get('country'));
}
function fnGetCountryList() {
var countrylist = new Array();
$.ajax({
url: '${pageContext.request.contextPath}/admin/getcountrylist.html',
async: false,
dataType: 'json',
success: function (json) {
for(var i=0; i
[code]
$('select', editor.node('country')).on('change', function () {
fnGetStateList(editor.get('country'))
});
editor.on('onInitCreate onInitEdit', function () {
editor.add({
"label": "State:",
"name": "state",
"type": "select"
});
editor.add({
"label": "Country:",
"name": "country",
"type": "select"
});
fnGetCountryList();
fnGetStateList(editor.get('country'));
}
function fnGetCountryList() {
var countrylist = new Array();
$.ajax({
url: '${pageContext.request.contextPath}/admin/getcountrylist.html',
async: false,
dataType: 'json',
success: function (json) {
for(var i=0; i
This discussion has been closed.