Hello
i am using these two function to add row to the grid first i submit the form and insert data to database then i return the inserted values as json after that i am trying to insert row to the grid but it is not working
$(“#add_photo”).live(“click”,function(){
var check = $(‘#gallery_photo’).jqxValidator(‘validate’);
$(“#gallery_photo”).submit(function(e){
if (check == true) {
$(“#gallery_photo”).ajaxSubmit({
success: afterSuccess,
dataType: “json”
});
}
e.preventDefault();
return false;
}) ;
});
function afterSuccess(responseText, statusText, xhr, $form) {
var row={};
var photo_code=responseText.photo_code;
row[“section_title_ar”]=responseText.section_code;
row[“photo_desc_ar”] = responseText.photo_desc_ar;
row[“photo_desc_en”]=responseText.photo_desc_en;
row[“photo_file”]=responseText.photo_file;
$(“#jqxgrid”).jqxGrid(‘addrow’, photo_code,row);
}
thank you
okasha