<script type="text/javascript"> $(document).ready(function () { $('.dedit-simple').doomEdit({ajaxSubmit:false, afterFormSubmit: function (data, form, el) {el.text(data);}}); }); </script>
Please click me to edit!
<script type="text/javascript"> $(document).ready(function () { $('.dedit-simple').doomEdit({ajaxSubmit:false, editField: '<textarea name="myEditTextarea" rows="10" cols="70"></textarea>', afterFormSubmit: function (data, form, el) {el.text(data);}}); }); </script>
Try to edit the text above:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vestibulum rhoncus egestas. Sed id massa velit, interdum consequat est. Cras malesuada nisi eu ligula mollis posuere quis eget risus. Ut sed lacus ante. Cras et arcu id quam pellentesque interdum. Etiam nec lectus sed velit volutpat feugiat. Sed mattis, enim vel dictum porta, purus arcu cursus lorem, non euismod elit ipsum nec leo.
<script type="text/javascript"> $(document).ready(function () { $('.dedit-simple').doomEdit({ajaxSubmit:false, editField: '<select name="myEditSelect"><option value="male">male</option><option value="female">female</option></select>', afterFormSubmit: function (data, form, el) {el.text(data);}}); }); </script>
Try to edit the text above:
I am a male.
Give a 'data-placeholder="some placeholder"' attribute to your editable element to display a placeholder when your element has no text.
<script type="text/javascript"> $(document).ready(function () { $('.dedit-simple').doomEdit({placeholder: true, ajaxSubmit:false, afterFormSubmit: function (data, form, el) {el.text(data);}}); }); </script>
Please to edit!
Set 'submitOnBlur: true' option to true if you want to save the new data on outside click (when the edit element looses it's focus).
<script type="text/javascript"> $(document).ready(function () { $('.dedit-simple').doomEdit({submitOnBlur: true, ajaxSubmit:false, submitBtn: false, cancelBtn: false, afterFormSubmit: function (data, form, el) {el.text(data);}}); }); </script>
Please edit me and click outside to save the new data!
<script type="text/javascript"> $(document).ready(function () { $('.dedit-remote').doomEdit({editForm:{method:'post', action:'remote.html', id:'myeditformid'}, afterFormSubmit: function (data, form, el) {el.text($('input', form).val());alert(data);}}); }); </script>
Please click me to edit and save the content remotely!
<script type="text/javascript"> $(document).ready(function () { $('.dedit-remote-json').doomEdit({editForm:{method:'post', action:'remote_json.html', id:'myeditformid'}, afterFormSubmit: function (data, form, el) {data = $.parseJSON(data);el.text(data.message);alert(data.message);}}); }); </script>
Please click me to edit and save the content remotely! A JSON response will be parsed.
<script type="text/javascript"> $(document).ready(function () { //Edit multiple cells inline $('.edit-cell-inline').doomEdit({ajaxSubmit:false, afterFormSubmit: function (data, form, el) {el.text(data);}}); }); </script>
Col 1 | Col 2 |
---|---|
1111 | 2222 |
3333 | 4444 |
5555 | 6666 |
7777 | 8888 |