Solution to flash problem of bootstrap modal

Time:2020-10-3

The scenario here is that a JS method for modification and addition will eventually call $(‘# modalrowedit’). Modal (‘show ‘); button is used to add and modify the a tag.

Modify label:

< a onclick = "editrow (this)" data toggle = "modal" data target ">" modalrowedit "> Modify</a>
 
// js
function editRow(obj) {
     var colData = dataTable1.row(obj.parentNode.parentNode).data();
     //$('ා modalrowedit'). Modal ('show '); finally, the method is called to display modal
     buildForm(colData);
}

New Tags:

< button class = "BTN btn-primary pull-right col-sm-1" id = "newdata" > New < / button >
 
// js
$("#newData").on('click', function() {
       //$('ා modalrowedit'). Modal ('show '); finally, the method is called to display modal
       buildForm();
});

The level is limited. I didn’t noticeA tag is directly bound through the attribute modal, you do not need to call it manually$('#modalRowEdit').modal('show'); so the dialog box flashed. Button is displayed by manual call, so no problem.

summary

This article about the solution to the flash problem of bootstrap modal is introduced here. For more relevant flash content of bootstrap modal, please search the previous articles of developeppaer or continue to browse the related articles below. I hope you can support developeppaer more in the future!