当前位置:网站首页>Layer pop-up layer closing problem

Layer pop-up layer closing problem

2022-07-07 12:50:00 Full stack programmer webmaster

When adding or modifying , Data needs to be submitted to the background for processing , At this time, the best state after adding successfully is to close the pop-up layer and refresh the data information of the list , I have always wanted to achieve this , But it has never been successful , Today, I decided to do a good job , I've seen it carefully layer After the help manual and consulting materials , With the following solutions :

One 、 Close the pop-up window

   This is a layer The help manual given on the official website , The explanations were quite detailed

There are two cases :

1、 When the pop-up layer is not a new page , Get the index of the pop-up window directly , And then execute close Method

layer.close();

2、 When the pop-up window is a new page

var index=parent.layer.getFrameIndex(window.name);

parent.layer.close(index);

Two 、 Refresh the parent page after closing the pop-up window

   for example : When adding users , Adding will pop up a new pop-up page , After adding success, there will be suggestive small alert, After clicking OK , Pop up page closes , And refresh the page data of the user list .

   Just add this when closing the pop-up window window.parent.location.reload();// Refresh parent page

Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/113462.html Link to the original text :https://javaforall.cn

原网站

版权声明
本文为[Full stack programmer webmaster]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207071036122767.html