1.1.144 clearselection
Version: public version
Parameters:
Purpose: Clear the row data in the grid.
Reference instance:
Mygrid. clearselection ();
1.1.145 enableblockselection (Mode)
Version: dhtmlxgrid_selection.js is required for the public version.
Parameters:
Mode: True/false
Purpose: Check whether the row data in the grid is dimmed.
Reference instance:
1.1.146 enablemultiselect (state)
Version: dhtmlxgrid_selection.js is required for the public version.
Parameters:
Mode: True/false
Purpose: whether multiple row selection modes are supported
Reference instance:
1.1.147 forcelabelselection (Mode)
Version: dhtmlxgrid_selection.js is required for the public version.
Parameters:
Mode: True/false
Purpose: whether to bind only visible content to the selected value, excluding all values.
Reference instance:
1.1.148 selectall
Version: public version
Parameters:
Purpose: select all the rows in the current grid, but no event is triggered. It must be called after all rows are loaded.
Reference instance:
Sort operation
1.1.149 enablestablesorting (Mode)
Version: public version
Parameters:
Mode: True/false
Purpose: Fixed Sorting Algorithm
Reference instance:
1.1.150 getsortingstate
Version: public version
Parameters:
Purpose: Obtain the array, index, and direction of each column.
Reference instance:
1.1.151 setcustomsorting (func, col)
Version: Professional Edition
Parameters:
FUNC: custom processing functions
Col: column Index
Purpose: Customize sorting
Reference instance:
Mygrid. setcustomsorting (sort_custom, 1 );
...
Function sort_custom (a, B, order ){
VaR n = A. length;
VaR M = B. length;
If (Order = "ASC ")
Return n> M? 1:-1;
Else
Return n <m? 1:-1;
}
1.1.152 setsortimgstate (State, IND, order, row)
Version: public version
Parameters:
State: True/false whether to display the sorted Image
IND: column Index
Order: sort in ascending or descending order
Row: multiple headers are, and the header is sweaty.
Purpose: set the sorting status of each column.
Reference instance:
// Minimal parameters set
Mygrid. setsortimgstate (true, 1)
// Maximal parameters set
Mygrid. setsortimgstate (false, 1, "des", 2 );
1.1.153 sortrows (COL, type, order)
Version: public version
Parameters:
Col: column Index
Type: Sort data type string, time, number, etc. The default value is the data type of the current column.
Order: sort in ascending or descending order
Purpose: set the sorting status of each column.
Reference instance:
// Sort first column in Grid
Mygrid. sortrows (0 );
// Sort first column in grid by "str" type in "des" Order
Mygrid. sortrows (0, "str", "des ");
Filter operation
1.1.154 collectvalues (column)
Version: public version
Parameters:
Column: column Index
Purpose: return an array of all possible values in the current column. No duplicates exist.
Reference instance:
VaR values = mygrid. collectvalues (1 );
1.1.155 filterby (column, value, preserve)
Version: The dedicated version must be supported by dhtmlxgrid_filter.js.
Parameters:
Column: column Index
Value: sets the filtered value.
Preserve: whether to filter the current or initial data
Purpose: set the column filter operation.
Reference instance:
// Fixed-Value Data Filtering
Mygrid. filterby (1, "ALF ");
// Custom filter value
Mygrid. filterby (1, function (data ){
Return data. tostring (). indexof ("ALF ")! =-1; // true-show the related row, false-hide the related row
});
// Filter the current data
Mygrid. filterby (2, "Omega", true );
1.1.156 filterbyall
Version: The dedicated version must be supported by dhtmlxgrid_filter.js.
Parameters:
Purpose: set the input box or custom function to filter all data.
Reference instance:
1.1.157 findcell (value, c_ind, first)
Version: The dedicated version must be supported by dhtmlxgrid_filter.js.
Parameters:
Value: Search Value
C_ind: column index, search range. If this parameter is not set, global search is performed.
First: whether to return the first one
Purpose: Find the matched cells in the grid, return the array object, row ID + column Index
Reference instance:
VaR searchresult = mygrid. findcell ("ALF ");
VaR searchresult = mygrid. findcell ("ALF", 1, true );
1.1.158 getfilterelement (INDEX)
Version: the public version requires dhtmlxgrid_filter.js support
Parameters:
Index: column Index
Purpose: Obtain the filtering objects in the current column of the grid.
Reference instance:
VaR filterobject = mygrid. getfilterelement (0 );
1.1.159 makefilter (ID, column, preserve)
Version: Professional Edition requires dhtmlxgrid_filter.js support
Parameters:
ID: Page Object or ID
Column: column Index
Preserve: Filter Based on the current value or initial value
Purpose: Create a filter based on an object on the page.
Reference instance:
Mygrid. makefilter ("some_el", 0 );
Mygrid. makefilter ("some_el", 0, true );
(Note: All my articles are original articles. Please indicate the source for reprinting! 20100628 is written in Shenzhen .)