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

Source: Internet
Author: User
Tags sqlite



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


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.