Created
October 11, 2018 17:27
-
-
Save melissathinkiq/db38ec75d3215ab8c41f5de6f54f33ec to your computer and use it in GitHub Desktop.
Modified save_all and edit_all functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function save_all() { | |
let ids = jQuery("#tags").jqGrid("getDataIDs"); | |
for (let id in changedIds) { | |
jQuery("#tags").jqGrid("saveRow", id); | |
} | |
for (let i = 0; i < ids.length; i++) { | |
id = ids[i]; | |
jQuery("#edit_row_list1_"+id).show(); | |
jQuery("#save_row_list1_"+id).hide(); | |
} | |
} | |
function edit_all() { | |
let ids = jQuery("#tags").jqGrid("getDataIDs"); | |
for (let i = 0; i < ids.length; i++) { | |
id = ids[i]; | |
jQuery("#tags").editRow(id, true, function() {}, function() { | |
if (jQuery("#edit_row_list1_").val() != undefined) { | |
jQuery("#edit_row_list1_"+id).show(); | |
jQuery("#save_row_list1_"+id).hide(); | |
} | |
return true; | |
}, null, null, function() { | |
},null, | |
function() { | |
if (jQuery("#edit_row_list1_").val() != undefined) { | |
jQuery("#edit_row_list1_"+id).show(); | |
jQuery("#save_row_list1_"+id).hide(); | |
} | |
return true; | |
} | |
); | |
jQuery("#edit_row_list1_"+id).hide(); | |
jQuery("#save_row_list1_"+id).show(); | |
} | |
jQuery(".editable").on("change", function(e) { | |
let id = parseInt(e.target.id).toString(); | |
if (!changedIds[id]) { | |
changedIds[id] = 1; | |
} | |
else { | |
changedIds[id]++; | |
} | |
}); | |
// set focus on first cell | |
setTimeout('jQuery(".editable:first").focus()',100); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment