jquery - Jeditable displaying whole page in place of edited row -
i using jeditable edit table rows. problem after submitting changed value (and storing in database) when return page displays whole page in place of edited row. displaying outside table.
-------table-------------- row11 row12 row21 row22 --------------------------
suppose changed row11
, updated value in database. whole table displayed 2 times. first under row11
, second time outside table. cannot figure out why happening.
below script using sending value, , other things:
<script type="text/javascript"> $(document).ready(function() { $('.edit').editable('', { indicator : 'saving...', tooltip : 'click edit...' }); $('.edit_area').editable('http://localhost:8080/interceptors_struts2_ant/parameters.action', { type : 'textarea', cancel : 'cancel', submit : 'ok', indicator : '<img src="img/indicator.gif">', submitdata : function() { var id2 = '${param.city}'; return {city: id2, tableid: $(this).closest('table').attr('id'), rowid: $(this).parent().index()}}, tooltip : 'click edit....', name : 'newvalue' }); }); </script>
it because submitdata return value being displayed edited element is. avoid this, still keep functionally did use callback.
callback: function(value, settings) { $(this).text(value); }
add .editable , have post action return text want displayed. (value return value of post)
Comments
Post a Comment