Title: Extend EasyUI component Post by: chkaufmann on February 19, 2014, 01:17:46 AM What is the save way to add own functions to components.
For example I would like to group the following lines in one call var n = tt.treegrid('getSelected'); var d = tt.treegrid('getData'); tt.treegrid('loadData', d); if ( n ) tt.treegrid('select', n.id); This should become something like this tt.treegrid('myRefresh'); or tt.treegrid.myRefresh(); cu Christian Title: Re: Extend EasyUI component Post by: stworthy on February 19, 2014, 01:27:32 AM Try this:
Code: <script> Now you can call 'myRefresh' method. Code: $('#tg').treegrid('myRefresh'); Title: Re: Extend EasyUI component Post by: chkaufmann on February 19, 2014, 02:04:32 AM Great!
One additional question: I defined an onSelect function but would like to disable it during the call to 'select' here. Is this possible? cu Christian Title: Re: Extend EasyUI component Post by: stworthy on February 19, 2014, 06:47:37 AM Please use the updated code:
Code: <script> |