javascript - jqGrid.info_dialog is not a function, do I have to call extend? -
i try use info_dialog
on jqgrid, see typeerror: $(...).jqgrid.info_dialog not function
in console.
i have (!) not defined own info_dialog
function. can see 1 in $.extend($.jgrid, ...
here, expecting available default.
info_dialog : function(caption, content,c_b, modalopt) { var mopt = { width:290, height:'auto',
do somehow have enable grid? or else have can use version defined here (call extend
on grid? ..)
using 4.6.0 https://cdnjs.com/libraries/jqgrid
using https://cdnjs.com/libraries/free-jqgrid 4.14.1
jqgrid defines not "standard" methods, can used $("#grid").jqgrid("methodname", ...)
or $("#grid").methodname(...)
, other methods. "standard" methods registered under $.fn.jqgrid.methodname
(like $.fn.jqgrid.editgridrow
function example) and, if no $.jgrid.no_legacy_api = true;
specified before $.jgrid.no_legacy_api = true;
, under $.fn.methodname
too.
in other words there exist global object $.fn.jqgrid
or $.fn
, contains "standard" jqgrid methods.
some other list of methods registered under $.jgrid
instead of $.fn.jqgrid
or $.fn
. info_dialog
example of such method. 1 should use $.jgrid.info_dialog
, $.jgrid.jqid
, $.jgrid.htmlencode
, $.jgrid.randid
, on use such methods. of methods don't require initialize this
(like $.jgrid.randid()
$.jgrid.jqid("some.text")
), methods require this
initialized dom of grid (the empty <table>
used generate grid).
for example, can use
$grid.jqgrid("navbuttonadd", "#pager", { caption: "test", onclickbutton: function () { $.jgrid.info_dialog.call(this, "warning 2 buttons", "click `test` button", "close", { buttons: [ { text: "\"text\" button", id: "buttid", onclick: function() { alert("click..."); } } ] } ); } });
see https://jsfiddle.net/olegki/xlrbdspo/. use in demo free jqgrid fork, develop, same works retro version 4.6 of jqgrid, use.
the final remark. if know syntax of typescript, can find in free-jqgrid.d.ts answers on many of questions usage of info_dialog
. methods , properties of $.jgrid
described here (inclusive info_dialog). find here additionally methods $.fmatter
, $.jqm
, $.jqdnr
, $.unformat
part of jqgrid in same way $.jgrid
.
Comments
Post a Comment