Currently, I am utilizing jQgrid for displaying a list with data retrieved through Ajax. The list is displaying properly without any issues.
However, my challenge lies in dynamically populating the list of options based on the status value received.
Area for fetching data:
$(function(){
search_provider();
// resizing grid
$(window).on('resize.jqGrid', function() {
$("#requestList").jqGrid('setGridWidth', $(".grid-cover").width());
})
});
function search_provider() {
var queryData = $("#searchList").serialize();
$.ajax({
url : "/v1/point/admin/provider/game_provider_list",
type : "GET",
dataType : "json",
data: queryData,
success : function(result) {
$("#resultLength").text(result.jqgrid_data.length);
if(result.jqgrid_data.length == 0){
noData();
}else{
$('#grid-cover').show();
$('#no-data').hide();
setRequestList(result.jqgrid_data)
}
}
})
}
Area to be dynamically filled:
{
name : 'approval_status',
index : 'approval_status',
align : 'center',
editable : true,
edittype : 'select',
formatter : 'select',
editoptions : {
value : "0:Unauthorized;1:Approval;2:Hold;3:Denial of approval;4:Reclamation",
dataEvents : [{
type : 'change',
fn : function(e) {
...
}
}]
}
}
The lists are currently being displayed.
For approval_status
value '0', display
"0:Unauthorized;1:Approval;2:Hold;3:Denial of approval"
For approval_status
value '1', display "1:Approval;4:Reclamation"
For approval_status
value '2', display
"1:Approval;2:Hold;3:Denial of approval"
For approval_status
value '3', display
"1:Approval;2:Hold;3:Denial of approval"
I wish to make the above changes. What would be the solution to this issue?