Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript jqGrid更改默认警报文本_Javascript_Jquery_Jqgrid - Fatal编程技术网

Javascript jqGrid更改默认警报文本

Javascript jqGrid更改默认警报文本,javascript,jquery,jqgrid,Javascript,Jquery,Jqgrid,我想知道是否有办法将jqGriddelete对话框的默认文本消息“Please,select row”更改为其他内容。当使用msg选项选择行时,我可以更改文本,使用caption选项更改标题,但是,我似乎无法更改警报文本 我查看了grid.locale en.js文件,找到了。它是根据: nav : { edittext: "", edittitle: "Edit selected row", addtext:"", addtitle: "Add new row"

我想知道是否有办法将
jqGrid
delete对话框的默认文本消息“Please,select row”更改为其他内容。当使用
msg
选项选择行时,我可以更改文本,使用
caption
选项更改标题,但是,我似乎无法更改警报文本

我查看了
grid.locale en.js
文件,找到了。它是根据:

nav : {
    edittext: "",
    edittitle: "Edit selected row",
    addtext:"",
    addtitle: "Add new row",
    deltext: "",
    deltitle: "Delete selected row",
    searchtext: "",
    searchtitle: "Find records",
    refreshtext: "Refresh",
    refreshtitle: "Reload Grid",
    alertcap: "Warning",
    alerttext: "Please, select row",   <-----
    viewtext: "",
    viewtitle: "View selected row"
},
nav:{
编辑文本:“”,
edittitle:“编辑所选行”,
addtext:“”,
addtitle:“添加新行”,
deltext:“”,
deltitle:“删除所选行”,
搜索文本:“”,
searchtitle:“查找记录”,
刷新文本:“刷新”,
刷新标题:“重新加载网格”,
alertcap:“警告”,
alerttext:“请选择行”,尝试:


这可以在设置网格导航选项的同时完成

如果要针对任何单个网格或页面执行此操作,请在网格导航选项中设置“alerttext”和“alertcaption”。例如:

jQuery(“#yourgrid”).jqGrid('navGrid','#YourGridPager', {

}

如果您想实现本地化,那么也可以使用参考资料设置这些文本

$.extend($.jgrid.nav,{alerttext:"Here my text for select row"});
  "edit": true, 
  "add": true,
   addCaption: "Your custom add caption",
   "del": true, 
   "search": false,
   "addtext": "custom add text",
   "edittext": "custom edit text",
   "deltext": "custom delete text",
   "alertcap": "Warning caption",
   "alerttext": "Warning text"