javascript - JQGrid onSelectRow event and jquery.simplemodal.js modal dialog -


i trying show modal window using jquery.simplemodal.js jquery plugin everytime click on row of jqgrid.

after doing it, once user click "yes" on modal window show document on iframe using info retrieved row, if click "no" iframe shows form edit info related document. idea keep iframe content blank until user clicks on 1 of buttons. accomplish using jqgrid onselectrow event follows:

onselectrow: function () {              var id = $("#tabresbusubi").getgridparam('selrow');             var row = $('#tabresbusubi').jqgrid('getrowdata', id);             viewdocument = false;              myconfirm('open document view?', function () {                 viewdocument = true;                         });               if (viewdocument) {                  $('#ifrshowpdf').ready(function () {                     $('#divloading').css('display', 'none');                 });                  $('#ifrshowpdf').attr('src', 'resource\\' + row.filepath);                 $('#ifrshowpdf').css('display', 'block');              } else {                 var rnd = math.floor(math.random() * 11);                 $('#ifrshowpdf').attr('src', 'document.asp?r=' + rnd + '&o=d&a=a&p=' + id);                 $('#ifrshowpdf').css('display', 'block');             }              return false;  }  function myconfirm(message, callback) {  $('#confirm').modal({      closehtml: "<a href='#' title='close' class='modal-close'>x</a>",     position: ["20%", ],     overlayid: 'confirm-overlay',     containerid: 'confirm-container',     onshow: function (dialog) {          var modal = this;         $('.message', dialog.data[0]).append(message);          $('.yes', dialog.data[0]).click(function () {                             if ($.isfunction(callback)) {                 callback.apply();                 $('#confirm-overlay').css('z-index', 5000);             }                             modal.close();          });     } });  } 

after click on row, modal popups, iframe shows edit document form when haven't clicked on of option buttons. if click "yes" option after, document viewed but, not intend do.

i appreciate suggestions make work.


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -