Select Field : is it possible to reload via ajax on editTemplate?
See original GitHub issueIs it possible to reload select field items on it field self when editTemplate is called? I try to do like this but not running sorry my English is not good
{title:"Category",type:"select", name:"prodCatId", items:dataCategory,valueField:"prodCatId",textField:"prodCatDesc",
editTemplate : function(){
var sbuField = this._grid.fields[0];
var $editControl = jsGrid.fields.select.prototype.editTemplate.call(this,arguments);
$editControl.on("change", function(){
var selectedSbuId = sbuField.editControl[0].value;
var selectedprodCatId = $(this).val();
$.ajax({
type: "POST",
url: "./getDataCategoryList",
data:{"sbuId":selectedSbuId,"prodCatId":selectedprodCatId},
success: function(data){
dataCategory = data
},
error : function(error){alert('error')}
});
});
return $editControl;
},
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
reload data from select tag each ajax request - Stack Overflow
Your code is working fine but you need to empty option and append the new value you got it form ajax call. $('#subcarousel_type').empty();....
Read more >joomla 3.x - Reload admin form after save field in database
In a custom component I need the user in the edit view of an item to be able to load a field in...
Read more >Documentation - jsGrid
editTemplate is a function to create cell content of editing row. ... select. Select field renders <select> control in filter, inserting and editing...
Read more >Reload or Refresh a Page after Ajax Success using jQuery
You can use the .reload() method inside an Ajax success callback function using jquery. ... Get file size, name and type from multiple...
Read more >Refresh/Auto update dropdownlist - MSDN - Microsoft
I know something like this can be done using AJAX but I cannot seem to direct myself into right direction. Can some please...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@heiovsky , yes Right exactly like that
so we have 1 record, and add new record
now we have 2 different record, then click on Canada record, state field is empty. . how do i showed the data and choice ??
in my case, country and state items in deferent source. and state items have dynamic value depend on selected country. Sorry my English is not good…
I have 3 dependency dropdown, categoryA, categoryB, categoryC. the items of categoryC(items:dataCategory) depends on what i chose in the categoryA and categoryB, i use ajax to hit server and get list, it works and items for categoryC is change,
The problem when i chose dropdown on the other row into editing mode where the value(valueField:“prodCatId”) of the dropdown was not found in list(dataCategory) which i got before, so the dropdown showing empty,
ex:
i try to reload just items (items:dataCategory) on $editControl, i use ajax again to hit server . In the hope of items(items:dataCategory) will be load again based on value of categoryA and categoryB in that row…