Jump to content

add new field at admin side order listing and separately save it in database


Recommended Posts

I have gotten special requirement in prestashop admin side order listing page.

 

In that i need one filed custom_note which is only for admin in order listing page.

 

custom_note should be editable like textfield or textarea at listing page only and update or save it at listing page.custom_note should be edit and update at listing.

 

 

i have completed to displaying filed in listing of orders .but i cant figure out how i can edit custom_note at listing page only and update it.

 

i attached screenshot what i have done.

 

please help me

post-796035-0-00260600-1400141106_thumb.png

Edited by unnati (see edit history)
Link to comment
Share on other sites

I have solved it

 

i have done it with jquery only

 

$(document).ready(function() {
 
$('.custom_note_edit').dblclick(function(e) {
 
      $(this).addClass("cellEditing");
       var trobj = $(this).closest('tr');
      var order = $.trim(trobj.children('td.order_id').text());
      var cval = $.trim($(this).text());
      $(this).html("<input type='text' id='editable_note' value='" + cval + "' />");
      $(this).children().first().focus();
     $(this).children().first().blur(function(){ 
     var newContent = $(this).val();
 
     /** here call your function for updating the field value to database **/
 
       $(this).parent().text(newContent);
       $(this).parent().removeClass("cellEditing");
   });
 
});
 
});
 
here custom_note_edit is class associate with td which contain custom_note on order list page
Link to comment
Share on other sites

×
×
  • Create New...