The project needs to run repeatedly to adjust the bug. When you select an existing tab, you do not need to create a new tab to jump directly to an existing tab, but the problem is that the display of the DataGrid will cause toolbar to disappear. There are many students on the Internet similar problems, as if the Easyui in the DataGrid source code bug, the first time to load the DataGrid page will not be the problem.
Here, I fix the code by using the idea of letting the DataGrid reload every time:
Modify the code in the (Home) index as follows
$ (‘# Tt‘). Tree ({
onClick: function (node) {
//alert(node.id);
if (! (node.id == ‘1’ || node.id == ‘11’ || node.id == ‘12’))
{
//alert(node.text); // alert node text property when clicked
// add a new tab panel here uses exists to determine if the tab already exists
if ($ (‘# tabs’). tabs (‘exists’, node.text))
{
// ‘select’ reactivate the existing tab, and the datagrid toolbar will be displayed incompletely.
var tab = $ (‘# tabs’). tabs (‘getTab’, node.text); // get selected panel
tab.panel (‘refresh’, ‘/ Home / UserEvent’);
$ (‘# Tabs’). Tabs (‘select’, node.text);
}
else
{
$ (‘# Tabs’). Tabs (‘add‘, {
title: node.text,
// content: "hello!",
href: ‘/ Home / UserEvent’,
closable: true,
});
}
}
}
});
The idea is that before selecting the existing tab, to select the existing Tabrefresh, to achieve the first time to open the DataGrid effect, toolbar disappear problem no longer appears. But the price of doing this is to reload the consumed time. If we have a better solution, we hope to share it actively. Thank you!
Asp.net+mvc+easyui+sqlite simple User System learning Journey (V)--Resolve tabs selection has been built tab display but the DataGrid's toolbar disappears