Dependent dropdown example

Dependent dropdown example

matthewjmatthewj Posts: 39Questions: 2Answers: 0
edited June 2013 in Editor
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
This discussion has been closed.