EasyUI Forum
April 25, 2024, 01:42:09 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: how to remove row on treegrid of easyui for vue  (Read 7165 times)
kpeng99@126.com
Newbie
*
Posts: 1


View Profile Email
« on: March 24, 2020, 09:17:30 PM »

Hi,
Would you please tell me how to remove row on treegrid of easyui for vue?
I can't find any mehtods on the documents.
Thanks a lot!!

William
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: March 29, 2020, 01:50:48 AM »

The code below shows how to remove the selected row from the TreeGrid.
Code:
<TreeGrid
style="height:250px"
:data="data"
idField="id"
treeField="name"
:selection="selection"
@selectionChange="selection=$event"
>
...
Code:
if (this.selection.parent) {
  const index = this.selection.parent.children.findIndex(
    row => row == this.selection
  );
  if (index >= 0) {
    this.selection.parent.children.splice(index, 1);
  }
} else {
  const index = this.data.findIndex(row => row == this.selection);
  if (index >= 0) {
    this.data.splice(index, 1);
  }
}
this.data = this.data;
« Last Edit: March 29, 2020, 01:57:56 AM by jarry » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!