0

i am jsgrid i want have implemented the add row button. when i click on thet button its open the form in dialog box with submit and cancel button.

i just want to add the row in in jqgrid. i dont want to save it to database how can i achieve this.

Thanks

Shivi
  • 1,075
  • 9
  • 24
  • 42
  • Your title is Add row and save, but your post is add row, but dont save it.?? and you are not jsgrid. You are using JSGrid. – Serkan Hekimoglu Sep 21 '10 at 07:28
  • Is it not the same question (see http://stackoverflow.com/questions/3751499/add-row-in-jqgrid) which you asked before? Moreover you use jgrid in title, jsgrid in text and jqgrid in tags. Do you mean really jqGrid? – Oleg Sep 21 '10 at 08:28
  • Yes...(http://www.trirand.com/blog/jqgrid/jqgrid.html) – Shivi Sep 21 '10 at 09:23
  • "Yes" for "the same question" or for "jqGrid"? Why you not use `addRowData`? If you fill jqGrid with the data from the server (from the database at the end) why you need to add a row which will be removed at the next data refresh like sorting, paging and so on? If all rows has an id extracted from the database which id you want get to the "empty row"? You should better describe the situation which you have then one could help you. If you write too less information other have to write more about this and ask you more about. – Oleg Sep 21 '10 at 10:14

1 Answers1

0

have solved the problem using..

it add the new empty row to the GRid...

onClickButton: function() {
          var last = jQuery('#test').jqGrid('getGridParam','records'); 
                      //alert(last);   
              AddNewRow (last);
          }

v

var AddNewRow = function(id){

                      var datarow = {Consultant:"",Role:"",Task:"",SDate:"",EDate:"",
                                       Deliverables:"",Complete:""};

                      var lastsel2 = parseInt(id) + 1;
                      //debugger;
                      var su=jQuery("#test").addRowData(lastsel2, datarow, "last") ;
//                  if (su) { 
//                          jQuery('#test').editRow(lastsel2,true); 
//                                            
//                     
//                           }  


                      };
Shivi
  • 1,075
  • 9
  • 24
  • 42