About the use of easyui's datagrid in layui

When using layui's tabs or components of a collapsible panel in a project, use easyui's datagrid to load data in the tab or collapsible panel. If the data grid cannot be displayed, it may be solved by monitoring the layui's element. In the tab, the index of the selected tab can be obtained by listening, and then the datagrid in the corresponding tab can be judged to be loaded. In the folding panel, according to the user manual of layui, the listening event returns our panel expansion state, the DOM object of the panel title area and the DOM object of the panel content area, but it seems to be of no use. My actual situation is that each fold There is a datagrid in the panel. The data loaded is different. My approach is to splicing the necessary elements of the loaded data of each table into the ID of the table in advance, and splicing these necessary elements into a string. When listening to the collapsed panel expansion When , these necessary elements are intercepted into the array, and then the array is looped to determine whether it exists according to the ID of the table. If it exists, the data of the table is reloaded, but there is a problem with this that the large amount of data may affect the query. The speed of the data, and every time a listening event is triggered, the data of the datagrid in the panel needs to be reloaded. It does not feel very reasonable. Personally, I think the most reasonable approach should be to monitor the clicked panel and only load the clicked panel. datagrid data. Please comment if there is a better way to do it. emmmmm, thanks for this.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324709784&siteId=291194637