When the same dialog of easyUI is loaded multiple times, easyuidialog is loaded.

Source: Internet
Author: User

When the same dialog of easyUI is loaded multiple times, easyuidialog is loaded.

Today, when you refresh the tab page, we find that the dialog content remains unchanged each time. It only changes after you refresh the entire page.

At first, I thought it was a cache, because the page uses velocity's # parse and thought velocity would cache the # parse page.

After reading response, the returned page is indeed changed, which is not a cache issue.

I checked the page elements and found that there are two dialog with the same id. That's why! Why?

Because easyUI will be placed in the body no matter where the dialog definition is when parsing dialog.

While refreshing the tab, we only refresh all the elements in a tab panel, so we resolved the dialog again during the refresh, so we can see multiple dialog.

So how can we solve this problem?

1. Place the dialog in the main interface, instead of loading it through the tab.

2. Destroy the previous dialog when refreshing the tab.

Here I used the second method. Let's take a look.

OnBeforeLoad: function (param) {if (title = 'test') {if ($ ('# repairsPaper') [0]) {$ ('# repairsPaper '). dialog ('deststroy', true );}}}



Why can't I load a page in dialog (loaded with href and passed the action) in easyui, but the page style cannot be displayed?

Did you write the loaded dialog page? <! DOCTYPE html...>
When jQuery EasyUI is used on the interface with IE, load one in dialog.

Min 'an Guotai meets the prosperous times and passes through the annual approval of China: min Tai Guoan

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.