When a grid row in Ligerui-js is modified, why is the Save event not executed? (Resolved)

Source: Internet
Author: User

When a grid row in Ligerui-js is modified, why is the Save event not executed? (Resolved)

(1)


(2) The following code is written above the grid

function Itemclick1 (item) {var editingrow = Grid.geteditingrow (); Switch (item.text) {case "add": if (Editingrow = = null) {GRID.ADDEDITR                  ow ();                  } else {Lg.tip (' please submit or Cancel first ');              } break;                  Case "Modified": var selected = grid.getselected (); if (Editingrow = = null) {BeginEdit ()} else {Lg.tip ("Please submit or cancel the repair first                  Change ");              } break;                      Case "Save": if (editingrow! = null) {alert ("Save 11");                  Grid.endedit (Editingrow);                  } else {Lg.tip (' not currently in edit State ');              } break;    Case "Cancel": if (editingrow! = null) {Grid.canceledit (editingrow);              } else {Lg.tip (' not in edit state now! ');              } break;                          Case "Delete": $.ligerdialog.confirm (' OK delete? ', function (confirm) {if (confirm)                  F_delete (grid, 1);                  });              Break          Case "action button": break; }}//load toolbar var toolbarOptions1 = {items: [{text: ' Add ', Click:itemclick1, IMG: ".. /lib/icons/silkicons/add.png "}, {line:true}, {text: ' Modify ', Click:itemclick1, img:". ./lib/icons/miniicons/page_edit.gif "}, {line:true}, {text: ' Save ', Click:itemclick1, img:". /lib/icons/silkicons/page_save.png "}, {line:true}, {text: ' Cancel ', Click:itemclick1, IMG: ". /lib/icons/silkicons/cancel.png "}, {line:true}, {text: ' delete ', Click:itemclick1, img:". /lib/Icons/miniicons/page_delete.gif "}]}; 

(3You must write the code, otherwise you cannot enter (add, modify) Save method


Toolbar event function Toolbarbtnitemclick (item) {var editingrow = Grid.geteditingrow (); Switch (item.id) {case "add"://top.f_addtab (NULL, ' Add role info ', ' membermanage/roledetail.aspx ')                  );                  if (Editingrow = = null) {Addnewrow ();                  } else {Lg.tip (' please submit or cancel the modification first ');              } break;                  Case "View": var selected = grid.getselected ();              if (!selected) {lg.tip (' Please select line! '); return} break;                  Case "Modify": var selected = grid.getselected (); if (!selected) {lg.tip (' Please select line! '); return}//top.f_addtab (null, ' Modify role information ', ' membermanage/roledetail.aspx?i D= ' + selected.                  Roleid);                  if (Editingrow = = null) {BeginEdit ();                  } else {Lg.tip (' please submit or cancel the modification first ');            }      Break Case "Delete": jQuery.ligerDialog.confirm (' OK delete? ', function (confirm) {if (Confirm                  ) F_delete ();                  });              Break                  Case "Save": if (editingrow! = null) {Grid.endedit (editingrow);                  } else {Lg.tip (' not in edit state now! ');              } break;                  Case "Cancel": if (editingrow! = null) {Grid.canceledit (editingrow);                  } else {Lg.tip (' not in edit state now! ');          } break; }      }



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.