zoukankan      html  css  js  c++  java
  • jqgrid学习(一)

    jqgrid中对于自带的工具按钮 : formatter : 'action' 的回掉方法:

    formatter : 'actions',
            				formatoptions : {
            					keys : true,
            					delOptions : {
            						recreateForm : true,
            						beforeShowForm : beforeDeleteCallback,
            						errorTextFormat: function (response) {
            		  				 return response.responseText;
            		  				},
            		  				//执行删除后的回掉方法
            						afterSubmit : function(response, postdata) { 						
            							 $(this).trigger("reloadGrid");
            							reloadTree();
            							return [true, response.responseText];
            		        		}
            					},
                                            editformbutton: true,
            					editOptions : {
            						closeAfterEdit: true,
            						//执行编辑后的回掉方法
            						afterSubmit : function(response, postdata) { 						
            							 $(this).trigger("reloadGrid");
            							reloadTree();
            							return [true, response.responseText];
            		        		}
            					}
            					
            				}
    

    jqgrid中自带的导航栏按钮的回掉方法:

    jQuery(grid_selector).jqGrid('navGrid', pager_selector, { // navbar options
            			edit : true,
            			editicon : 'ace-icon fa fa-pencil blue',
            			add : false,
            			addicon : 'ace-icon fa fa-plus-circle purple',
            			del : true,
            			delicon : 'ace-icon fa fa-trash-o red',
            			search : true,
            			searchicon : 'ace-icon fa fa-search orange',
            			refresh : true,
            			refreshicon : 'ace-icon fa fa-refresh blue',
            			view : true,
            			viewicon : 'ace-icon fa fa-search-plus grey'
            		}, {
            			// edit record form
            			// closeAfterEdit: true,
            			 800,
            			closeAfterEdit: true,
            			recreateForm : true,
            			beforeShowForm : function(e) {
            				var form = $(e[0]);
            				form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar').wrapInner('<div class="widget-header" />')
            				style_edit_form(form);
            			},
        				errorTextFormat: function (response) {
        					 return response.responseText;
        				},
        				//执行编辑后的回掉方法
    					afterSubmit : function(response, postdata) { 						
    						 $(this).trigger("reloadGrid");
    						reloadTree();
    						return [true, response.responseText];
    	        			}
            		}, {
            			// new record form
            			 800,
            			closeAfterAdd : true,
            			recreateForm : false,
            			viewPagerButtons : false,
            			beforeShowForm : function(e) {
            				var form = $(e[0]);
            				form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar').wrapInner('<div class="widget-header" />')
            				style_edit_form(form);
            			},
            			errorTextFormat: function (response) {
        					 return response.responseText;
        				},
            			//执行添加后的回掉方法
    					afterSubmit : function(response, postdata) { 						
    						 $(this).trigger("reloadGrid");
    						reloadTree();
    						return [true, response.responseText];
    	        			}
            		}, {
            			// delete record form
            			recreateForm : true,
            			beforeShowForm : function(e) {
            				var form = $(e[0]);
            				if (form.data('styled'))
            					return false;
            				form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar').wrapInner('<div class="widget-header" />')
            				style_delete_form(form);
            				form.data('styled', true);
            			},//执行删除后的回掉方法
    					afterSubmit : function(response, postdata) { 
    						alert("del_test");
    						 $(this).trigger("reloadGrid");
    						reloadTree();
    						return [true, response.responseText];
    	       			},
    	       			errorTextFormat: function (response) {
        					//var result = $.parseJSON(response.responseText);
        				    return response.responseText;
        				}
            		}, {
            			// search form
            			recreateForm : true,
            			afterShowSearch : function(e) {
            				var form = $(e[0]);
            				form.closest('.ui-jqdialog').find('.ui-jqdialog-title').wrap('<div class="widget-header" />')
            				style_search_form(form);
            			},
            			afterRedraw : function() {
            				style_search_filters($(this));
            			},
            			multipleSearch : true 
                
            		}, {
            			// view record form
            			 800,
    	       			recreateForm : true,
    	       			beforeShowForm : function(e) {
    	       				var form = $(e[0]);
    	       				form.closest('.ui-jqdialog').find('.ui-jqdialog-title').wrap('<div class="widget-header" />')
    	       			}
            		});
    

      

  • 相关阅读:
    PHP打印各种金字塔!
    PhpStorm常用快捷键大全
    JS实现点击按钮,自增输入框个数
    分布式版本控制系统Git的安装与使用
    碳云智能Java实习面试(offer到手含面试经验及答案)
    特斯联Java实习面试(offer到手含面试经验及答案)
    图森未来Java实习面试(offer到手含面试经验及答案)
    洋码头Java实习面试(offer到手含面试经验及答案)
    一起作业Java实习面试(offer到手含面试经验及答案)
    医联Java实习面试(offer到手含面试经验及答案)
  • 原文地址:https://www.cnblogs.com/grj0011/p/7279232.html
Copyright © 2011-2022 走看看