Workaround
For the DataGrid For example, the following code is added to the definition:
JavaScript Code
1 2 3 4 5 6 7 8 9 10 |
|
Onloadsuccess:function(data) { if(Data.total = =0) { $(' #dg '). DataGrid (' InsertRow ', { Row: {} }); $("#dg"). Parent (). Find ("tr[datagrid-row-index= ' 0 ']"). CSS ({ "Visibility":"Hidden" }); } } |
Update log
By the @ Cloud flying classmate guidance, the above part of the code to make changes.
Here are the comments from the @ Cloud flying Classmates:
The whole idea is correct, just need to change the selection under the limit, otherwise it will affect all the DataGrid, will all the first row of the DataGrid to hide out.
Easyui handles the DataGrid by preserving and encapsulating the table portion of the ID, adding datagrid-view1 and datagrid-view2 two child elements, which form a sibling relationship between the view and the original table. The first view is used to place frozen columns, and there is data in the frozen column.
View2 to place data in the natural column. So, the scope of the code should be written like this:
[JavaScript]View Plaincopyprint
"Style=" Color:rgb (204,204,204); Text-decoration:none; Border:none; padding:0px; margin:0px 10px 0px 0px; font-size:9px; Background-color:inherit "?
- $ ( "#dg" "tr[datagrid-row-index= ' 0 ']"
- "Visibility" : "Hidden"
Original code:
JavaScript Code
1 2 3 4 5 6 7 8 9 10 11 |
|
Onloadsuccess:function(data) { if(Data.total = =0) { $(' #dg '). DataGrid (' InsertRow ', { Row: {} }); $("tr[datagrid-row-index= ' 0 ']"). CSS ({ "Visibility":"Hidden" }); } }
|
Copyright notice: This article Bo Master original articles, blogs, without consent may not be reproduced.
Workaround Easyui There is no data problem when the DataGrid does not display scroll bars