jquery - How to refresh dialog content -
i have dialog tha contains partialview. possible undo changes user makes inside dialog, if user decides cancel dialog , not save?
if user opens same dialog changes still there if user cancelled dialog. know possible call controller , replace partial view.
is there other way?
sanke - store contents of div in .data() element when partialview first loaded. then, if it's cancelled (without saving), push .data() in div created dialog.
actions speak louder words:
// partial getting loaded $("#targetdiv").html(data); var foo = document.body; jquery.data(foo, "mykey", data);
then on cancel reverse:
// inside dialog cancel event var foo = document.body; var data = jquery.data(foo, "mykey"); $("#targetdiv").html(data);
give try...
Comments
Post a Comment