diff --git a/CHANGE-LOG b/CHANGE-LOG
index e299ad1..a0fa231 100644
--- a/CHANGE-LOG
+++ b/CHANGE-LOG
@@ -1,10 +1,11 @@
-v1.37 2015-09-13 使用优化、性能优化、BUG修复
+v1.37 2015-11-24 使用优化、性能优化、BUG修复
1,修复pageSize为0或pageAll为tue且数据条数为0时隐藏不了表头列的bug;
2,增加参数showPageToolbar控制是否显示分页工具条,默认值true显示;
3,增加9个方法,获取分页及排序相关值;
4,修复当页记录条数为0时不执行afterRenderGridMethods系列方法的bug;
5,增加grid属性ajaxType,默认post,可修改为get;
+6,增强分页工具条的按钮显示、最小宽度自定义;
diff --git a/README.md b/README.md
index b768ec4..5d22369 100644
--- a/README.md
+++ b/README.md
@@ -5,13 +5,13 @@ jQuery.bsgrid - 简单实用、功能丰富、易扩展的jQuery Grid插件
源码:[Github](https://github.com/baishui2004/jquery.bsgrid/)
-演示:皮肤
- 示例
- 文档
+演示:皮肤
+ 示例
+ 文档
-版本:1.36
+版本:1.37
协议:Apache Licence 2
- 更新:2015-06-25
+ 更新:2016-01-21
依赖:jQuery 1.4.4 ~~ jQuery 1.11.2
@@ -19,32 +19,32 @@ jQuery.bsgrid - 简单实用、功能丰富、易扩展的jQuery Grid插件
QQ群交流:254754154
-捐助:支持长远发展,感谢您的认可!
+捐助:支持长远发展,感谢您的认可!
###皮肤效果###
-内置多套皮肤(点击图片查看示例页面),并可非常容易的定制皮肤[示例:Custom Blue Style]
+内置多套皮肤(点击图片查看示例页面),并可非常容易的定制皮肤[示例:Custom Blue Style]
-
-
+
+
###bsgrid的由来###
首先,解释插件名称为何叫bsgrid,是因为作者常用bs开头的字符做英文账号的缘故。bsgrid的诞生因为主流插件、框架的grid使用或扩展比较复杂,而本插件作者力图开发一款使用简单、功能实用、容易扩展的grid控件,目前已初步实现此目标。
###bsgrid的特点###
- 1,简单、轻量,基于jQuery及HTML Table,简单的表格只需数十行代码,支持大数据量表格;
-
2,内置多套经典皮肤,且非常容易定制,字体定制只需要修改两处CSS代码即可;
-
3,实用便捷的功能:表格编辑、
- 表底聚合、
- 不分页、
- 多行表头、
- 多字段排序、
- 本地数据、
- 处理Userdata、
- 拖动列宽、
- 滚动表格数据等;
-
4,易与其他插件集成使用,示例展示了集成Layui、
- ArtDialog、
- jquery.validationEngine、
+ 1,简单、轻量,基于jQuery及HTML Table,简单的表格只需数十行代码,支持大数据量表格;
+
2,内置多套经典皮肤,且非常容易定制,字体定制只需要修改两处CSS代码即可;
+
3,实用便捷的功能:表格编辑、
+ 表底聚合、
+ 不分页、
+ 多行表头、
+ 多字段排序、
+ 本地数据、
+ 处理Userdata、
+ 拖动列宽、
+ 滚动表格数据等;
+
4,易与其他插件集成使用,示例展示了集成Layui、
+ ArtDialog、
+ jquery.validationEngine、
第三方分页工具条等的使用;
5,扩展性好,插件有特别好的扩展性,易于对插件本身进行局部甚至较大的修改,易于改变展现样式;插件放开了属性及方法的全局修改权限,所有方法都可在外部进行全局重写,而无需修改插件本身的代码;
6,模块化JS、CSS代码,可按需加载,代码精致简洁,对于阅读、修改、扩展非常容易。
diff --git a/builds/css/grid.paging.min.css b/builds/css/grid.paging.min.css
index d0872e8..4f18850 100644
--- a/builds/css/grid.paging.min.css
+++ b/builds/css/grid.paging.min.css
@@ -1 +1 @@
-@CHARSET "UTF-8";.bsgridPaging{font-size:13px;font-family:'微软雅黑',Verdana,sans-serif,'宋体',serif;width:770px;border-collapse:collapse}.bsgridPaging.pagingLittleToolbar{width:550px}.bsgridPaging.noPageSizeSelect{width:650px}.bsgridPaging.pagingLittleToolbar.pagingLittleToolbar{width:430px}.bsgridPaging td{text-align:center}.bsgridPaging select{font-size:inherit;width:auto;height:auto;padding:1px;margin:1px}.bsgridPaging .pagingBtn{cursor:pointer;border:solid 1px #ccc;background:url(../images/skins/default/bg.gif) repeat-x #f4f4f4;font-size:inherit;font-family:inherit;color:inherit;padding:1px 3px;margin:1px}.bsgridPaging.pagingLittleToolbar .pagingBtn{width:16px;border-width:0;background:transparent no-repeat;padding:0;margin:3px}.bsgridPaging .pagingBtn.disabledCls{color:#999;filter:alpha(opacity=50);opacity:.5;-moz-opacity:.5}.bsgridPaging.pagingLittleToolbar .pagingBtn.firstPage{background-image:url(../images/icons/paging/go-first-view.png)}.bsgridPaging.pagingLittleToolbar .pagingBtn.prevPage{background-image:url(../images/icons/paging/go-previous-view.png)}.bsgridPaging.pagingLittleToolbar .pagingBtn.nextPage{background-image:url(../images/icons/paging/go-next-view.png)}.bsgridPaging.pagingLittleToolbar .pagingBtn.lastPage{background-image:url(../images/icons/paging/go-last-view.png)}.bsgridPaging .gotoPageInputTd{width:44px}.bsgridPaging .gotoPageInput{width:40px;height:auto;font-size:inherit;line-height:1em;color:inherit;border:solid 1px #ccc;padding:1px;margin:1px}.bsgridPaging .gotoPageButtonTd{text-align:left}.bsgridPaging .refreshPageTd{text-align:right;padding-right:4px}.bsgridPaging.pagingLittleToolbar .pagingBtn.gotoPage{background-image:url(../images/icons/paging/go-jump-2.png)}.bsgridPaging.pagingLittleToolbar .pagingBtn.refreshPage{background-image:url(../images/icons/paging/view-refresh-3.png)}
\ No newline at end of file
+@CHARSET "UTF-8";.bsgridPaging{font-size:13px;font-family:'微软雅黑',Verdana,sans-serif,'宋体',serif;width:770px;border-collapse:collapse}.bsgridPaging.pagingLittleToolbar{width:550px}.bsgridPaging.noPageSizeSelect{width:650px}.bsgridPaging.pagingLittleToolbar.noPageSizeSelect{width:430px}.bsgridPaging td{text-align:center}.bsgridPaging select{font-size:inherit;width:auto;height:auto;padding:1px;margin:1px}.bsgridPaging .pagingBtn{cursor:pointer;border:solid 1px #ccc;background:url(../images/skins/default/bg.gif) repeat-x #f4f4f4;font-size:inherit;font-family:inherit;color:inherit;padding:1px 3px;margin:1px}.bsgridPaging.pagingLittleToolbar .pagingBtn{width:16px;border-width:0;background:transparent no-repeat;padding:0;margin:3px}.bsgridPaging .pagingBtn.disabledCls{color:#999;filter:alpha(opacity=50);opacity:.5;-moz-opacity:.5}.bsgridPaging.pagingLittleToolbar .pagingBtn.firstPage{background-image:url(../images/icons/paging/go-first-view.png)}.bsgridPaging.pagingLittleToolbar .pagingBtn.prevPage{background-image:url(../images/icons/paging/go-previous-view.png)}.bsgridPaging.pagingLittleToolbar .pagingBtn.nextPage{background-image:url(../images/icons/paging/go-next-view.png)}.bsgridPaging.pagingLittleToolbar .pagingBtn.lastPage{background-image:url(../images/icons/paging/go-last-view.png)}.bsgridPaging .gotoPageInputTd{width:44px}.bsgridPaging .gotoPageInput{width:40px;height:auto;font-size:inherit;line-height:1em;color:inherit;border:solid 1px #ccc;padding:1px;margin:1px}.bsgridPaging .gotoPageButtonTd{text-align:left}.bsgridPaging .refreshPageTd{text-align:right;padding-right:4px}.bsgridPaging.pagingLittleToolbar .pagingBtn.gotoPage{background-image:url(../images/icons/paging/go-jump-2.png)}.bsgridPaging.pagingLittleToolbar .pagingBtn.refreshPage{background-image:url(../images/icons/paging/view-refresh-3.png)}
\ No newline at end of file
diff --git a/builds/js/common.min.js b/builds/js/common.min.js
index e7c8507..dbcfbc6 100644
--- a/builds/js/common.min.js
+++ b/builds/js/common.min.js
@@ -1,5 +1,5 @@
/**
-* jQuery.bsgrid v1.36 by @Baishui2004
+* jQuery.bsgrid v1.37 by @Baishui2004
* Copyright 2014 Apache v2 License
* https://github.com/baishui2004/jquery.bsgrid
*/
diff --git a/builds/js/export.min.js b/builds/js/export.min.js
index cb245ec..39672ca 100644
--- a/builds/js/export.min.js
+++ b/builds/js/export.min.js
@@ -1,5 +1,5 @@
/**
-* jQuery.bsgrid v1.36 by @Baishui2004
+* jQuery.bsgrid v1.37 by @Baishui2004
* Copyright 2014 Apache v2 License
* https://github.com/baishui2004/jquery.bsgrid
*/
diff --git a/builds/js/form.min.js b/builds/js/form.min.js
index c4ec81f..ea0bcd8 100644
--- a/builds/js/form.min.js
+++ b/builds/js/form.min.js
@@ -1,5 +1,5 @@
/**
-* jQuery.bsgrid v1.36 by @Baishui2004
+* jQuery.bsgrid v1.37 by @Baishui2004
* Copyright 2014 Apache v2 License
* https://github.com/baishui2004/jquery.bsgrid
*/
diff --git a/builds/js/grid.extend.min.js b/builds/js/grid.extend.min.js
index 928a454..63d723b 100644
--- a/builds/js/grid.extend.min.js
+++ b/builds/js/grid.extend.min.js
@@ -1,5 +1,5 @@
/**
-* jQuery.bsgrid v1.36 by @Baishui2004
+* jQuery.bsgrid v1.37 by @Baishui2004
* Copyright 2014 Apache v2 License
* https://github.com/baishui2004/jquery.bsgrid
*/
diff --git a/builds/js/grid.min.js b/builds/js/grid.min.js
index a2bc4ff..e238a53 100644
--- a/builds/js/grid.min.js
+++ b/builds/js/grid.min.js
@@ -1,6 +1,6 @@
/**
-* jQuery.bsgrid v1.36 by @Baishui2004
+* jQuery.bsgrid v1.37 by @Baishui2004
* Copyright 2014 Apache v2 License
* https://github.com/baishui2004/jquery.bsgrid
*/
-(function($){$.fn.bsgrid={version:"1.36",defaults:{dataType:"json",ajaxType:"post",localData:false,url:"",otherParames:false,autoLoad:true,pageAll:false,showPageToolbar:true,pageSize:20,pageSizeSelect:false,pageSizeForGrid:[5,10,20,25,50,100,200,500],pageIncorrectTurnAlert:true,multiSort:false,displayBlankRows:true,lineWrap:false,stripeRows:false,rowHoverColor:false,rowSelectedColor:true,pagingLittleToolbar:false,pagingToolbarAlign:"right",pagingBtnClass:"pagingBtn",displayPagingToolbarOnlyMultiPages:false,isProcessLockScreen:true,longLengthAotoSubAndTip:true,colsProperties:{align:"center",maxLength:40,indexAttr:"w_index",sortAttr:"w_sort",alignAttr:"w_align",lengthAttr:"w_length",renderAttr:"w_render",hiddenAttr:"w_hidden",tipAttr:"w_tip"},requestParamsName:{pageSize:"pageSize",curPage:"curPage",sortName:"sortName",sortOrder:"sortOrder"},beforeSend:function(options,XMLHttpRequest){},complete:function(options,XMLHttpRequest,textStatus){},processUserdata:function(userdata,options){},event:{selectRowEvent:false,unselectRowEvent:false,customRowEvents:{},customCellEvents:{}},extend:{initGridMethods:{},beforeRenderGridMethods:{},renderPerRowMethods:{},renderPerColumnMethods:{},afterRenderGridMethods:{}},additionalBeforeRenderGrid:function(parseSuccess,gridData,options){},additionalRenderPerRow:function(record,rowIndex,trObj,options){},additionalRenderPerColumn:function(record,rowIndex,colIndex,tdObj,trObj,options){},additionalAfterRenderGrid:function(parseSuccess,gridData,options){}},gridObjs:{},init:function(gridId,settings){if(!$("#"+gridId).hasClass("bsgrid")){$("#"+gridId).addClass("bsgrid")}var options={settings:$.extend(true,{},$.fn.bsgrid.defaults,settings),gridId:gridId,noPagingationId:gridId+"_no_pagination",pagingOutTabId:gridId+"_pt_outTab",pagingId:gridId+"_pt",sortName:"",sortOrder:"",otherParames:settings.otherParames,totalRows:0,totalPages:0,curPage:1,curPageRowsNum:0,startRow:0,endRow:0};if($("#"+gridId).find("thead").length==0){$("#"+gridId).prepend("");$("#"+gridId).find("tr:lt("+($("#"+gridId+" tr").length-$("#"+gridId+" tfoot tr").length)+")").appendTo($("#"+gridId+" thead"))}if($("#"+gridId).find("tbody").length==0){$("#"+gridId+" thead").after("
")}if($("#"+gridId).find("tfoot").length==0){$("#"+gridId).append('')}options.columnsModel=$.fn.bsgrid.initColumnsModel(options);if(settings.pageSizeForGrid!=undefined){options.settings.pageSizeForGrid=settings.pageSizeForGrid}options.settings.dataType=options.settings.dataType.toLowerCase();if(options.settings.pageSizeSelect){if($.inArray(options.settings.pageSize,options.settings.pageSizeForGrid)==-1){options.settings.pageSizeForGrid.push(options.settings.pageSize)}options.settings.pageSizeForGrid.sort(function(a,b){return a-b})}var gridObj={options:options,getPageCondition:function(curPage){return $.fn.bsgrid.getPageCondition(curPage,options)},page:function(curPage){$.fn.bsgrid.page(curPage,options)},search:function(params){$.fn.bsgrid.search(params,options)},loadGridData:function(dataType,gridData){$.fn.bsgrid.loadGridData(dataType,gridData,options)},getPageSize:function(){return options.settings.pageSize},getTotalRows:function(){return options.totalRows},getTotalPages:function(){return options.totalPages},getCurPage:function(){return options.curPage},getCurPageRowsNum:function(){return options.curPageRowsNum},getStartRow:function(){return options.startRow},getEndRow:function(){return options.endRow},getSortName:function(){return options.sortName},getSortOrder:function(){return options.sortOrder},getRows:function(){return $.fn.bsgrid.getRows(options)},getRow:function(row){return $.fn.bsgrid.getRow(row,options)},getRowCells:function(row){return $.fn.bsgrid.getRowCells(row,options)},getColCells:function(col){return $.fn.bsgrid.getColCells(col,options)},getCell:function(row,col){return $.fn.bsgrid.getCell(row,col,options)},getSelectedRow:function(){return $.fn.bsgrid.getSelectedRow(options)},getSelectedRowIndex:function(){return $.fn.bsgrid.getSelectedRowIndex(options)},selectRow:function(row){return $.fn.bsgrid.selectRow(row,options)},unSelectRow:function(){return $.fn.bsgrid.unSelectRow(options)},getUserdata:function(){return $.fn.bsgrid.getUserdata(options)},getRowRecord:function(rowObj){return $.fn.bsgrid.getRowRecord(rowObj)},getAllRecords:function(){return $.fn.bsgrid.getAllRecords(options)},getRecord:function(row){return $.fn.bsgrid.getRecord(row,options)},getRecordIndexValue:function(record,index){return $.fn.bsgrid.getRecordIndexValue(record,index,options)},getColumnValue:function(row,index){return $.fn.bsgrid.getColumnValue(row,index,options)},getCellRecordValue:function(row,col){return $.fn.bsgrid.getCellRecordValue(row,col,options)},sort:function(obj){$.fn.bsgrid.sort(obj,options)},getGridHeaderObject:function(){return $.fn.bsgrid.getGridHeaderObject(options)},getColumnModel:function(colIndex){return $.fn.bsgrid.getColumnModel(colIndex,options)},appendHeaderSort:function(){$.fn.bsgrid.appendHeaderSort(options)},setGridBlankBody:function(){$.fn.bsgrid.setGridBlankBody(options)},createPagingOutTab:function(){$.fn.bsgrid.createPagingOutTab(options)},clearGridBodyData:function(){$.fn.bsgrid.clearGridBodyData(options)},getPagingObj:function(){return $.fn.bsgrid.getPagingObj(options)},getCurPage:function(){return $.fn.bsgrid.getCurPage(options)},refreshPage:function(){$.fn.bsgrid.refreshPage(options)},firstPage:function(){$.fn.bsgrid.firstPage(options)},prevPage:function(){$.fn.bsgrid.prevPage(options)},nextPage:function(){$.fn.bsgrid.nextPage(options)},lastPage:function(){$.fn.bsgrid.lastPage(options)},gotoPage:function(goPage){$.fn.bsgrid.gotoPage(options,goPage)},initPaging:function(){return $.fn.bsgrid.initPaging(options)},setPagingValues:function(){$.fn.bsgrid.setPagingValues(options)}};$.fn.bsgrid.gridObjs[gridId]=gridObj;if(options.settings.pageAll||options.settings.pageSize<1){options.settings.pageAll=true;options.settings.pageSize=0}gridObj.appendHeaderSort();gridObj.createPagingOutTab();if(!options.settings.showPageToolbar){$("#"+options.pagingId).hide();$("#"+options.pagingOutTabId).hide()}if(!options.settings.pageAll){gridObj.pagingObj=gridObj.initPaging();try{var minWidth=$.trim($("#"+options.pagingId).children().width());minWidth=minWidth==""?0:parseInt(minWidth);if(minWidth!=0){$("#"+gridId).css("min-width",minWidth+16);$("#"+options.pagingOutTabId).css("min-width",minWidth+16)}$("#"+options.pagingOutTabId).width($("#"+gridId).width());$(window).resize(function(){$("#"+options.pagingOutTabId).width($("#"+gridId).width())})}catch(e){}}if(options.settings.isProcessLockScreen){$.fn.bsgrid.addLockScreen(options)}try{$.fn.bsgrid.extendInitGrid.initGridExtendOptions(gridId,options)}catch(e){}for(var key in options.settings.extend.initGridMethods){options.settings.extend.initGridMethods[key](gridId,options)}if(options.settings.autoLoad){setTimeout(function(){gridObj.page(1)},10)}else{gridObj.setGridBlankBody()}return gridObj},initColumnsModel:function(options){var columnsModel=[];$.fn.bsgrid.getGridHeaderObject(options).each(function(){var colsProperties=options.settings.colsProperties;var columnModel={};columnModel.sortName="";columnModel.sortOrder="";var sortInfo=$.trim($(this).attr(colsProperties.sortAttr));if(sortInfo.length!=0){var sortInfoArray=sortInfo.split(",");columnModel.sortName=$.trim(sortInfoArray[0]);columnModel.sortOrder=$.trim(sortInfoArray.length>1?sortInfoArray[1]:"")}columnModel.index=$.trim($(this).attr(colsProperties.indexAttr));columnModel.render=$.trim($(this).attr(colsProperties.renderAttr));columnModel.tip=$.trim($(this).attr(colsProperties.tipAttr));var maxLen=$.trim($(this).attr(colsProperties.lengthAttr));columnModel.maxLen=maxLen.length!=0?parseInt(maxLen):colsProperties.maxLength;var align=$.trim($(this).attr(colsProperties.alignAttr));columnModel.align=align==""?colsProperties.align:align;columnModel.hidden=$.trim($(this).attr(colsProperties.hiddenAttr));columnsModel.push(columnModel)});return columnsModel},getGridObj:function(gridId){var obj=$.fn.bsgrid.gridObjs[gridId];return obj?obj:null},buildData:{gridData:function(type,curPage,data){if(type=="json"){return $.fn.bsgrid.buildJsonData.gridData(curPage,data)}else{if(type=="xml"){return $.fn.bsgrid.buildXmlData.gridData(curPage,data)}}return false}},parseData:{success:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.success(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.success(gridData)}}return false},totalRows:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.totalRows(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.totalRows(gridData)}}return false},curPage:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.curPage(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.curPage(gridData)}}return false},data:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.data(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.data(gridData)}}return false},userdata:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.userdata(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.userdata(gridData)}}return false},getDataLen:function(type,gridData){if(type=="json"||type=="xml"){return $.fn.bsgrid.parseData.data(type,gridData).length}return 0},getRecord:function(type,data,row){if(type=="json"){return $.fn.bsgrid.parseJsonData.getRecord(data,row)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.getRecord(data,row)}}return false},getColumnValue:function(type,record,index){if(type=="json"){return $.fn.bsgrid.parseJsonData.getColumnValue(record,index)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.getColumnValue(record,index)}}return false}},buildJsonData:{gridData:function(curPage,data){return{success:true,totalRows:data.length,curPage:curPage,data:data}}},parseJsonData:{success:function(json){return json.success},totalRows:function(json){return json.totalRows},curPage:function(json){return json.curPage},data:function(json){return json.data},userdata:function(json){return json.userdata},getRecord:function(data,row){return data[row]},getColumnValue:function(record,index){return $.trim(record[index])}},buildXmlData:{gridData:function(curPage,data){return'true'+$(""+data+"").find("row").length+""+curPage+""+data+""}},parseXmlData:{success:function(xml){return $.trim($(xml).find("gridData success").text())=="true"},totalRows:function(xml){return parseInt($(xml).find("gridData totalRows").text())},curPage:function(xml){return parseInt($(xml).find("gridData curPage").text())},data:function(xml){return $(xml).find("gridData data row")},userdata:function(xml){return $(xml).find("gridData userdata")},getRecord:function(data,row){return data.eq(row)},getColumnValue:function(record,index){return $.trim(record.find(index).text())}},getPageCondition:function(curPage,options){var params=new StringBuilder();if(options.otherParames==false){}else{if((typeof options.otherParames).toLowerCase()=="string"||options.otherParames instanceof String){params.append("&"+options.otherParames)}else{if(options.otherParames instanceof Array){$.each(options.otherParames,function(i,objVal){params.append("&"+objVal.name+"="+objVal.value)})}else{for(var key in options.otherParames){params.append("&"+key+"="+options.otherParames[key])}}}}var condition=params.length==0?"":params.toString().substring(1);condition+=(condition.length==0?"":"&")+options.settings.requestParamsName.pageSize+"="+options.settings.pageSize+"&"+options.settings.requestParamsName.curPage+"="+curPage+"&"+options.settings.requestParamsName.sortName+"="+options.sortName+"&"+options.settings.requestParamsName.sortOrder+"="+options.sortOrder;return condition},search:function(params,options){options.otherParames=params;$.fn.bsgrid.page(1,options)},page:function(curPage,options){if($.trim(curPage)==""||isNaN(curPage)){$.fn.bsgrid.alert($.bsgridLanguage.needInteger);return}var dataType=options.settings.dataType;if(options.settings.localData!=false){if(dataType=="json"){$.fn.bsgrid.loadGridData(dataType,$.fn.bsgrid.buildData.gridData(dataType,curPage,options.settings.localData),options)}else{if(dataType=="xml"){$.fn.bsgrid.loadGridData(dataType,""+$.fn.bsgrid.buildData.gridData(dataType,curPage,options.settings.localData)+"",options)}}return}$.ajax({type:options.settings.ajaxType,url:options.settings.url,data:$.fn.bsgrid.getPageCondition(curPage,options),dataType:dataType,beforeSend:function(XMLHttpRequest){if(options.settings.isProcessLockScreen){$.fn.bsgrid.lockScreen(options)}options.settings.beforeSend(options,XMLHttpRequest)},complete:function(XMLHttpRequest,textStatus){options.settings.complete(options,XMLHttpRequest,textStatus);if(options.settings.isProcessLockScreen){$.fn.bsgrid.unlockScreen(options)}},success:function(gridData,textStatus){$.fn.bsgrid.loadGridData(dataType,gridData,options)},error:function(XMLHttpRequest,textStatus,errorThrown){$.fn.bsgrid.alert($.bsgridLanguage.errorForSendOrRequestData)}})},loadGridData:function(dataType,gridData,options){var parseSuccess=$.fn.bsgrid.parseData.success(dataType,gridData);for(var key in options.settings.extend.beforeRenderGridMethods){options.settings.extend.beforeRenderGridMethods[key](parseSuccess,gridData,options)}options.settings.additionalBeforeRenderGrid(parseSuccess,gridData,options);if(parseSuccess){var userdata=$.fn.bsgrid.parseData.userdata(dataType,gridData);$.fn.bsgrid.storeUserdata(userdata,options);options.settings.processUserdata(userdata,options);var totalRows=parseInt($.fn.bsgrid.parseData.totalRows(dataType,gridData));var curPage=parseInt($.fn.bsgrid.parseData.curPage(dataType,gridData));curPage=Math.max(curPage,1);if(options.settings.pageAll){curPage=1;options.settings.pageSize=totalRows;$("#"+options.noPagingationId).html(totalRows)}var pageSize=options.settings.pageSize;var totalPages=parseInt(totalRows/pageSize);totalPages=parseInt((totalRows%pageSize==0)?totalPages:totalPages+1);var curPageRowsNum=$.fn.bsgrid.parseData.getDataLen(dataType,gridData);curPageRowsNum=curPageRowsNum>pageSize?pageSize:curPageRowsNum;curPageRowsNum=(curPage*pageSize ';$(this).append(sortHtml).find(".sort").click(function(){$.fn.bsgrid.sort($(this).parent("th"),options)})}})},setGridBlankBody:function(options){$.fn.bsgrid.getRows(options).remove();var header=$.fn.bsgrid.getGridHeaderObject(options);var columnsModel=options.columnsModel;for(var hi=0;hi0){var trSb=new StringBuilder();trSb.append("");for(var hi=0;hi ")}trSb.append("
");rowSb=trSb.toString()}var rowsSb=new StringBuilder();var curPageRowsNum=options.settings.pageSize;if(!options.settings.displayBlankRows){curPageRowsNum=options.endRow-options.startRow+1;curPageRowsNum=options.endRow>0?curPageRowsNum:0}if(curPageRowsNum==0){rowsSb.append(''+$.bsgridLanguage.noDataToDisplay+" |
")}else{for(var pi=0;pi');if(options.settings.pageAll){pagingOutTabSb.append($.bsgridLanguage.noPagingation(options.noPagingationId)+" ")}pagingOutTabSb.append(" |
");$("#"+options.gridId).after(pagingOutTabSb.toString())},clearGridBodyData:function(options){$.fn.bsgrid.getRows(options).find("td").html(" ")},addLockScreen:function(options){if($(".bsgrid.lockscreen").length==0){var lockScreenHtml=new StringBuilder();lockScreenHtml.append('');lockScreenHtml.append("
");lockScreenHtml.append('');lockScreenHtml.append('
'+$.bsgridLanguage.loadingDataMessage+" |
");lockScreenHtml.append("
");$("body").append(lockScreenHtml.toString())}},lockScreen:function(options){$(".bsgrid.lockscreen").attr("times",parseInt($(".bsgrid.lockscreen").attr("times"))+1);if($(".bsgrid.lockscreen").css("display")=="none"){$(".bsgrid.lockscreen").show();$(".bsgrid.loading_div").show()}},unlockScreen:function(options){$(".bsgrid.lockscreen").attr("times",parseInt($(".bsgrid.lockscreen").attr("times"))-1);if($(".bsgrid.lockscreen").attr("times")=="0"){setTimeout(function(){$(".bsgrid.lockscreen").hide();$(".bsgrid.loading_div").hide()},50)}},columnTip:function(obj,value,record){$(obj).attr("title",value)},alert:function(msg){try{$.bsgrid.alert(msg)}catch(e){alert(msg)}},longLengthSubAndTip:function(obj,value,maxLen,record){var tip=false;if(value.length>maxLen){try{if(value.indexOf("<")<0||value.indexOf(">")<2||$(value).text().length==0){tip=true}}catch(e){tip=true}}if(tip){$(obj).html(value.substring(0,maxLen-3)+"...");$.fn.bsgrid.columnTip(obj,value,record)}else{$(obj).html(value)}},getPagingObj:function(options){return $.fn.bsgrid.getGridObj(options.gridId).pagingObj},getCurPage:function(options){return $.fn.bsgrid.getPagingObj(options).getCurPage()},refreshPage:function(options){if(!options.settings.pageAll){$.fn.bsgrid.getPagingObj(options).refreshPage()}else{$.fn.bsgrid.page(1,options)}},firstPage:function(options){$.fn.bsgrid.getPagingObj(options).firstPage()},prevPage:function(options){$.fn.bsgrid.getPagingObj(options).prevPage()},nextPage:function(options){$.fn.bsgrid.getPagingObj(options).nextPage()},lastPage:function(options){$.fn.bsgrid.getPagingObj(options).lastPage()},gotoPage:function(options,goPage){$.fn.bsgrid.getPagingObj(options).gotoPage(goPage)},initPaging:function(options){$("#"+options.pagingOutTabId+" td").attr("id",options.pagingId);return $.fn.bsgrid_paging.init(options.pagingId,{gridId:options.gridId,pageSize:options.settings.pageSize,pageSizeSelect:options.settings.pageSizeSelect,pageSizeForGrid:options.settings.pageSizeForGrid,pageIncorrectTurnAlert:options.settings.pageIncorrectTurnAlert,pagingLittleToolbar:options.settings.pagingLittleToolbar,pagingBtnClass:options.settings.pagingBtnClass})},setPagingValues:function(options){$.fn.bsgrid.getPagingObj(options).setPagingValues(options.curPage,options.totalRows)}}})(jQuery);
\ No newline at end of file
+(function($){$.fn.bsgrid={version:"1.37",defaults:{dataType:"json",ajaxType:"post",localData:false,url:"",otherParames:false,autoLoad:true,pageAll:false,showPageToolbar:true,pageSize:20,pageSizeSelect:false,pageSizeForGrid:[5,10,20,25,50,100,200,500],pageIncorrectTurnAlert:true,multiSort:false,displayBlankRows:true,lineWrap:false,stripeRows:false,rowHoverColor:false,rowSelectedColor:true,pagingLittleToolbar:false,pagingToolbarAlign:"right",pagingBtnClass:"pagingBtn",displayPagingToolbarOnlyMultiPages:false,isProcessLockScreen:true,longLengthAotoSubAndTip:true,colsProperties:{align:"center",maxLength:40,indexAttr:"w_index",sortAttr:"w_sort",alignAttr:"w_align",lengthAttr:"w_length",renderAttr:"w_render",hiddenAttr:"w_hidden",tipAttr:"w_tip"},requestParamsName:{pageSize:"pageSize",curPage:"curPage",sortName:"sortName",sortOrder:"sortOrder"},beforeSend:function(options,XMLHttpRequest){},complete:function(options,XMLHttpRequest,textStatus){},processUserdata:function(userdata,options){},event:{selectRowEvent:false,unselectRowEvent:false,customRowEvents:{},customCellEvents:{}},extend:{initGridMethods:{},beforeRenderGridMethods:{},renderPerRowMethods:{},renderPerColumnMethods:{},afterRenderGridMethods:{}},additionalBeforeRenderGrid:function(parseSuccess,gridData,options){},additionalRenderPerRow:function(record,rowIndex,trObj,options){},additionalRenderPerColumn:function(record,rowIndex,colIndex,tdObj,trObj,options){},additionalAfterRenderGrid:function(parseSuccess,gridData,options){}},gridObjs:{},init:function(gridId,settings){if(!$("#"+gridId).hasClass("bsgrid")){$("#"+gridId).addClass("bsgrid")}var options={settings:$.extend(true,{},$.fn.bsgrid.defaults,settings),gridId:gridId,noPagingationId:gridId+"_no_pagination",pagingOutTabId:gridId+"_pt_outTab",pagingId:gridId+"_pt",sortName:"",sortOrder:"",otherParames:settings.otherParames,totalRows:0,totalPages:0,curPage:1,curPageRowsNum:0,startRow:0,endRow:0};if($("#"+gridId).find("thead").length==0){$("#"+gridId).prepend("");$("#"+gridId).find("tr:lt("+($("#"+gridId+" tr").length-$("#"+gridId+" tfoot tr").length)+")").appendTo($("#"+gridId+" thead"))}if($("#"+gridId).find("tbody").length==0){$("#"+gridId+" thead").after("")}if($("#"+gridId).find("tfoot").length==0){$("#"+gridId).append('')}options.columnsModel=$.fn.bsgrid.initColumnsModel(options);if(settings.pageSizeForGrid!=undefined){options.settings.pageSizeForGrid=settings.pageSizeForGrid}options.settings.dataType=options.settings.dataType.toLowerCase();if(options.settings.pageSizeSelect){if($.inArray(options.settings.pageSize,options.settings.pageSizeForGrid)==-1){options.settings.pageSizeForGrid.push(options.settings.pageSize)}options.settings.pageSizeForGrid.sort(function(a,b){return a-b})}var gridObj={options:options,getPageCondition:function(curPage){return $.fn.bsgrid.getPageCondition(curPage,options)},page:function(curPage){$.fn.bsgrid.page(curPage,options)},search:function(params){$.fn.bsgrid.search(params,options)},loadGridData:function(dataType,gridData){$.fn.bsgrid.loadGridData(dataType,gridData,options)},reloadLocalData:function(localData){$.fn.bsgrid.reloadLocalData(localData,options)},getPageSize:function(){return options.settings.pageSize},getTotalRows:function(){return options.totalRows},getTotalPages:function(){return options.totalPages},getCurPage:function(){return options.curPage},getCurPageRowsNum:function(){return options.curPageRowsNum},getStartRow:function(){return options.startRow},getEndRow:function(){return options.endRow},getSortName:function(){return options.sortName},getSortOrder:function(){return options.sortOrder},getRows:function(){return $.fn.bsgrid.getRows(options)},getRow:function(row){return $.fn.bsgrid.getRow(row,options)},getRowCells:function(row){return $.fn.bsgrid.getRowCells(row,options)},getColCells:function(col){return $.fn.bsgrid.getColCells(col,options)},getCell:function(row,col){return $.fn.bsgrid.getCell(row,col,options)},getSelectedRow:function(){return $.fn.bsgrid.getSelectedRow(options)},getSelectedRowIndex:function(){return $.fn.bsgrid.getSelectedRowIndex(options)},selectRow:function(row){return $.fn.bsgrid.selectRow(row,options)},unSelectRow:function(){return $.fn.bsgrid.unSelectRow(options)},getUserdata:function(){return $.fn.bsgrid.getUserdata(options)},getRowRecord:function(rowObj){return $.fn.bsgrid.getRowRecord(rowObj)},getAllRecords:function(){return $.fn.bsgrid.getAllRecords(options)},getRecord:function(row){return $.fn.bsgrid.getRecord(row,options)},getRecordIndexValue:function(record,index){return $.fn.bsgrid.getRecordIndexValue(record,index,options)},getColumnValue:function(row,index){return $.fn.bsgrid.getColumnValue(row,index,options)},getCellRecordValue:function(row,col){return $.fn.bsgrid.getCellRecordValue(row,col,options)},sort:function(obj){$.fn.bsgrid.sort(obj,options)},getGridHeaderObject:function(){return $.fn.bsgrid.getGridHeaderObject(options)},getColumnModel:function(colIndex){return $.fn.bsgrid.getColumnModel(colIndex,options)},appendHeaderSort:function(){$.fn.bsgrid.appendHeaderSort(options)},setGridBlankBody:function(){$.fn.bsgrid.setGridBlankBody(options)},createPagingOutTab:function(){$.fn.bsgrid.createPagingOutTab(options)},clearGridBodyData:function(){$.fn.bsgrid.clearGridBodyData(options)},getPagingObj:function(){return $.fn.bsgrid.getPagingObj(options)},getCurPage:function(){return $.fn.bsgrid.getCurPage(options)},refreshPage:function(){$.fn.bsgrid.refreshPage(options)},firstPage:function(){$.fn.bsgrid.firstPage(options)},prevPage:function(){$.fn.bsgrid.prevPage(options)},nextPage:function(){$.fn.bsgrid.nextPage(options)},lastPage:function(){$.fn.bsgrid.lastPage(options)},gotoPage:function(goPage){$.fn.bsgrid.gotoPage(options,goPage)},initPaging:function(){return $.fn.bsgrid.initPaging(options)},setPagingValues:function(){$.fn.bsgrid.setPagingValues(options)}};$.fn.bsgrid.gridObjs[gridId]=gridObj;if(options.settings.pageAll||options.settings.pageSize<1){options.settings.pageAll=true;options.settings.pageSize=0}gridObj.appendHeaderSort();gridObj.createPagingOutTab();if(!options.settings.showPageToolbar){$("#"+options.pagingId).hide();$("#"+options.pagingOutTabId).hide()}if(!options.settings.pageAll){gridObj.pagingObj=gridObj.initPaging();try{var minWidth=$.trim($("#"+options.pagingId).children().width());minWidth=minWidth==""?0:parseInt(minWidth);if(minWidth!=0){$("#"+gridId).css("min-width",minWidth+16);$("#"+options.pagingOutTabId).css("min-width",minWidth+16)}$("#"+options.pagingOutTabId).width($("#"+gridId).width());$(window).resize(function(){$("#"+options.pagingOutTabId).width($("#"+gridId).width())})}catch(e){}}if(options.settings.isProcessLockScreen){$.fn.bsgrid.addLockScreen(options)}try{$.fn.bsgrid.extendInitGrid.initGridExtendOptions(gridId,options)}catch(e){}for(var key in options.settings.extend.initGridMethods){options.settings.extend.initGridMethods[key](gridId,options)}if(options.settings.autoLoad){setTimeout(function(){gridObj.page(1)},10)}else{gridObj.setGridBlankBody()}return gridObj},initColumnsModel:function(options){var columnsModel=[];$.fn.bsgrid.getGridHeaderObject(options).each(function(){var colsProperties=options.settings.colsProperties;var columnModel={};columnModel.sortName="";columnModel.sortOrder="";var sortInfo=$.trim($(this).attr(colsProperties.sortAttr));if(sortInfo.length!=0){var sortInfoArray=sortInfo.split(",");columnModel.sortName=$.trim(sortInfoArray[0]);columnModel.sortOrder=$.trim(sortInfoArray.length>1?sortInfoArray[1]:"")}columnModel.index=$.trim($(this).attr(colsProperties.indexAttr));columnModel.render=$.trim($(this).attr(colsProperties.renderAttr));columnModel.tip=$.trim($(this).attr(colsProperties.tipAttr));var maxLen=$.trim($(this).attr(colsProperties.lengthAttr));columnModel.maxLen=maxLen.length!=0?parseInt(maxLen):colsProperties.maxLength;var align=$.trim($(this).attr(colsProperties.alignAttr));columnModel.align=align==""?colsProperties.align:align;columnModel.hidden=$.trim($(this).attr(colsProperties.hiddenAttr));columnsModel.push(columnModel)});return columnsModel},getGridObj:function(gridId){var obj=$.fn.bsgrid.gridObjs[gridId];return obj?obj:null},buildData:{gridData:function(type,curPage,data){if(type=="json"){return $.fn.bsgrid.buildJsonData.gridData(curPage,data)}else{if(type=="xml"){return $.fn.bsgrid.buildXmlData.gridData(curPage,data)}}return false}},parseData:{success:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.success(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.success(gridData)}}return false},totalRows:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.totalRows(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.totalRows(gridData)}}return false},curPage:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.curPage(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.curPage(gridData)}}return false},data:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.data(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.data(gridData)}}return false},userdata:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.userdata(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.userdata(gridData)}}return false},getDataLen:function(type,gridData){if(type=="json"||type=="xml"){return $.fn.bsgrid.parseData.data(type,gridData).length}return 0},getRecord:function(type,data,row){if(type=="json"){return $.fn.bsgrid.parseJsonData.getRecord(data,row)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.getRecord(data,row)}}return false},getColumnValue:function(type,record,index){if(type=="json"){return $.fn.bsgrid.parseJsonData.getColumnValue(record,index)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.getColumnValue(record,index)}}return false}},buildJsonData:{gridData:function(curPage,data){return{success:true,totalRows:data.length,curPage:curPage,data:data}}},parseJsonData:{success:function(json){return json.success},totalRows:function(json){return json.totalRows},curPage:function(json){return json.curPage},data:function(json){return json.data},userdata:function(json){return json.userdata},getRecord:function(data,row){return data[row]},getColumnValue:function(record,index){return $.trim(record[index])}},buildXmlData:{gridData:function(curPage,data){return'true'+$(""+data+"").find("row").length+""+curPage+""+data+""}},parseXmlData:{success:function(xml){return $.trim($(xml).find("gridData success").text())=="true"},totalRows:function(xml){return parseInt($(xml).find("gridData totalRows").text())},curPage:function(xml){return parseInt($(xml).find("gridData curPage").text())},data:function(xml){return $(xml).find("gridData data row")},userdata:function(xml){return $(xml).find("gridData userdata")},getRecord:function(data,row){return data.eq(row)},getColumnValue:function(record,index){return $.trim(record.find(index).text())}},getPageCondition:function(curPage,options){var params=new StringBuilder();if(options.otherParames==false){}else{if((typeof options.otherParames).toLowerCase()=="string"||options.otherParames instanceof String){params.append("&"+options.otherParames)}else{if(options.otherParames instanceof Array){$.each(options.otherParames,function(i,objVal){params.append("&"+objVal.name+"="+objVal.value)})}else{for(var key in options.otherParames){params.append("&"+key+"="+options.otherParames[key])}}}}var condition=params.length==0?"":params.toString().substring(1);condition+=(condition.length==0?"":"&")+options.settings.requestParamsName.pageSize+"="+options.settings.pageSize+"&"+options.settings.requestParamsName.curPage+"="+curPage+"&"+options.settings.requestParamsName.sortName+"="+options.sortName+"&"+options.settings.requestParamsName.sortOrder+"="+options.sortOrder;return condition},search:function(params,options){if(params!=undefined){options.otherParames=params}else{options.otherParames=false}$.fn.bsgrid.page(1,options)},page:function(curPage,options){if($.trim(curPage)==""||isNaN(curPage)){$.fn.bsgrid.alert($.bsgridLanguage.needInteger);return}var dataType=options.settings.dataType;if(options.settings.localData!=false){if(dataType=="json"){$.fn.bsgrid.loadGridData(dataType,$.fn.bsgrid.buildData.gridData(dataType,curPage,options.settings.localData),options)}else{if(dataType=="xml"){$.fn.bsgrid.loadGridData(dataType,""+$.fn.bsgrid.buildData.gridData(dataType,curPage,options.settings.localData)+"",options)}}return}$.ajax({type:options.settings.ajaxType,url:options.settings.url,data:$.fn.bsgrid.getPageCondition(curPage,options),dataType:dataType,beforeSend:function(XMLHttpRequest){if(options.settings.isProcessLockScreen){$.fn.bsgrid.lockScreen(options)}options.settings.beforeSend(options,XMLHttpRequest)},complete:function(XMLHttpRequest,textStatus){options.settings.complete(options,XMLHttpRequest,textStatus);if(options.settings.isProcessLockScreen){$.fn.bsgrid.unlockScreen(options)}},success:function(gridData,textStatus){$.fn.bsgrid.loadGridData(dataType,gridData,options)},error:function(XMLHttpRequest,textStatus,errorThrown){$.fn.bsgrid.alert($.bsgridLanguage.errorForSendOrRequestData)}})},loadGridData:function(dataType,gridData,options){var parseSuccess=$.fn.bsgrid.parseData.success(dataType,gridData);for(var key in options.settings.extend.beforeRenderGridMethods){options.settings.extend.beforeRenderGridMethods[key](parseSuccess,gridData,options)}options.settings.additionalBeforeRenderGrid(parseSuccess,gridData,options);if(parseSuccess){var userdata=$.fn.bsgrid.parseData.userdata(dataType,gridData);$.fn.bsgrid.storeUserdata(userdata,options);options.settings.processUserdata(userdata,options);var totalRows=parseInt($.fn.bsgrid.parseData.totalRows(dataType,gridData));var curPage=parseInt($.fn.bsgrid.parseData.curPage(dataType,gridData));curPage=Math.max(curPage,1);if(options.settings.pageAll){curPage=1;options.settings.pageSize=totalRows;$("#"+options.noPagingationId).html(totalRows)}var pageSize=options.settings.pageSize;var totalPages=parseInt(totalRows/pageSize);totalPages=parseInt((totalRows%pageSize==0)?totalPages:totalPages+1);var curPageRowsNum=$.fn.bsgrid.parseData.getDataLen(dataType,gridData);curPageRowsNum=curPageRowsNum>pageSize?pageSize:curPageRowsNum;curPageRowsNum=(curPage*pageSize ';$(this).append(sortHtml).find(".sort").click(function(){$.fn.bsgrid.sort($(this).parent("th"),options)})}})},setGridBlankBody:function(options){$.fn.bsgrid.getRows(options).remove();var header=$.fn.bsgrid.getGridHeaderObject(options);var columnsModel=options.columnsModel;for(var hi=0;hi0){var trSb=new StringBuilder();trSb.append("");for(var hi=0;hi ")}trSb.append("
");rowSb=trSb.toString()}var rowsSb=new StringBuilder();var curPageRowsNum=options.settings.pageSize;if(!options.settings.displayBlankRows){curPageRowsNum=options.endRow-options.startRow+1;curPageRowsNum=options.endRow>0?curPageRowsNum:0}if(curPageRowsNum==0){rowsSb.append(''+$.bsgridLanguage.noDataToDisplay+" |
")}else{for(var pi=0;pi');if(options.settings.pageAll){pagingOutTabSb.append($.bsgridLanguage.noPagingation(options.noPagingationId)+" ")}pagingOutTabSb.append(" |
");$("#"+options.gridId).after(pagingOutTabSb.toString())},clearGridBodyData:function(options){$.fn.bsgrid.getRows(options).find("td").html(" ")},addLockScreen:function(options){if($(".bsgrid.lockscreen").length==0){var lockScreenHtml=new StringBuilder();lockScreenHtml.append('');lockScreenHtml.append("
");lockScreenHtml.append('');lockScreenHtml.append('
'+$.bsgridLanguage.loadingDataMessage+" |
");lockScreenHtml.append("
");$("body").append(lockScreenHtml.toString())}},lockScreen:function(options){$(".bsgrid.lockscreen").attr("times",parseInt($(".bsgrid.lockscreen").attr("times"))+1);if($(".bsgrid.lockscreen").css("display")=="none"){$(".bsgrid.lockscreen").show();$(".bsgrid.loading_div").show()}},unlockScreen:function(options){$(".bsgrid.lockscreen").attr("times",parseInt($(".bsgrid.lockscreen").attr("times"))-1);if($(".bsgrid.lockscreen").attr("times")=="0"){setTimeout(function(){$(".bsgrid.lockscreen").hide();$(".bsgrid.loading_div").hide()},50)}},columnTip:function(obj,value,record){$(obj).attr("title",value)},alert:function(msg){try{$.bsgrid.alert(msg)}catch(e){alert(msg)}},longLengthSubAndTip:function(obj,value,maxLen,record){var tip=false;if(value.length>maxLen){try{if(value.indexOf("<")<0||value.indexOf(">")<2||$(value).text().length==0){tip=true}}catch(e){tip=true}}if(tip){$(obj).html(value.substring(0,maxLen-3)+"...");$.fn.bsgrid.columnTip(obj,value,record)}else{$(obj).html(value)}},getPagingObj:function(options){return $.fn.bsgrid.getGridObj(options.gridId).pagingObj},getCurPage:function(options){return $.fn.bsgrid.getPagingObj(options).getCurPage()},refreshPage:function(options){if(!options.settings.pageAll){$.fn.bsgrid.getPagingObj(options).refreshPage()}else{$.fn.bsgrid.page(1,options)}},firstPage:function(options){$.fn.bsgrid.getPagingObj(options).firstPage()},prevPage:function(options){$.fn.bsgrid.getPagingObj(options).prevPage()},nextPage:function(options){$.fn.bsgrid.getPagingObj(options).nextPage()},lastPage:function(options){$.fn.bsgrid.getPagingObj(options).lastPage()},gotoPage:function(options,goPage){$.fn.bsgrid.getPagingObj(options).gotoPage(goPage)},initPaging:function(options){$("#"+options.pagingOutTabId+" td").attr("id",options.pagingId);return $.fn.bsgrid_paging.init(options.pagingId,{gridId:options.gridId,pageSize:options.settings.pageSize,pageSizeSelect:options.settings.pageSizeSelect,pageSizeForGrid:options.settings.pageSizeForGrid,pageIncorrectTurnAlert:options.settings.pageIncorrectTurnAlert,pagingLittleToolbar:options.settings.pagingLittleToolbar,pagingBtnClass:options.settings.pagingBtnClass})},setPagingValues:function(options){$.fn.bsgrid.getPagingObj(options).setPagingValues(options.curPage,options.totalRows)}}})(jQuery);
\ No newline at end of file
diff --git a/builds/js/grid.paging.min.js b/builds/js/grid.paging.min.js
index f786119..4dc93d7 100644
--- a/builds/js/grid.paging.min.js
+++ b/builds/js/grid.paging.min.js
@@ -1,6 +1,6 @@
/**
-* jQuery.bsgrid v1.36 by @Baishui2004
+* jQuery.bsgrid v1.37 by @Baishui2004
* Copyright 2014 Apache v2 License
* https://github.com/baishui2004/jquery.bsgrid
*/
-(function(a){a.fn.bsgrid_paging={defaults:{loopback:false,pageSize:20,pageSizeSelect:false,pageSizeForGrid:[5,10,20,25,50,100,200,500],pageIncorrectTurnAlert:true,pagingLittleToolbar:false,pagingBtnClass:"pagingBtn"},pagingObjs:{},init:function(h,g){var d={settings:a.extend(true,{},a.fn.bsgrid_paging.defaults,g),pagingId:h,totalRowsId:h+"_totalRows",totalPagesId:h+"_totalPages",curPageId:h+"_curPage",gotoPageInputId:h+"_gotoPageInput",gotoPageId:h+"_gotoPage",refreshPageId:h+"_refreshPage",pageSizeId:h+"_pageSize",firstPageId:h+"_firstPage",prevPageId:h+"_prevPage",nextPageId:h+"_nextPage",lastPageId:h+"_lastPage",startRowId:h+"_startRow",endRowId:h+"_endRow",totalRows:0,totalPages:0,curPage:1,curPageRowsNum:0,startRow:0,endRow:0};if(g.pageSizeForGrid!=undefined){d.settings.pageSizeForGrid=g.pageSizeForGrid}var b={options:d,page:function(i){a.fn.bsgrid_paging.page(i,d)},getCurPage:function(){return a.fn.bsgrid_paging.getCurPage(d)},refreshPage:function(){a.fn.bsgrid_paging.refreshPage(d)},firstPage:function(){a.fn.bsgrid_paging.firstPage(d)},prevPage:function(){a.fn.bsgrid_paging.prevPage(d)},nextPage:function(){a.fn.bsgrid_paging.nextPage(d)},lastPage:function(){a.fn.bsgrid_paging.lastPage(d)},gotoPage:function(i){a.fn.bsgrid_paging.gotoPage(d,i)},createPagingToolbar:function(){return a.fn.bsgrid_paging.createPagingToolbar(d)},setPagingToolbarEvents:function(){a.fn.bsgrid_paging.setPagingToolbarEvents(d)},dynamicChangePagingButtonStyle:function(){a.fn.bsgrid_paging.dynamicChangePagingButtonStyle(d)},setPagingValues:function(j,i){a.fn.bsgrid_paging.setPagingValues(j,i,d)}};a.fn.bsgrid_paging.pagingObjs[h]=b;a("#"+h).append(b.createPagingToolbar());if(d.settings.pageSizeSelect){if(a.inArray(d.settings.pageSize,d.settings.pageSizeForGrid)==-1){d.settings.pageSizeForGrid.push(d.settings.pageSize)}d.settings.pageSizeForGrid.sort(function(j,i){return j-i});var f=new StringBuilder();for(var e=0;e'+c+"")}a("#"+d.pageSizeId).html(f.toString()).val(d.settings.pageSize)}b.setPagingToolbarEvents();return b},getPagingObj:function(c){var b=a.fn.bsgrid_paging.pagingObjs[c];return b?b:null},page:function(c,b){var d=a.fn.bsgrid.getGridObj(b.settings.gridId);d.options.settings.pageSize=b.settings.pageSize;a.fn.bsgrid.page(c,d.options)},getCurPage:function(b){var c=a("#"+b.curPageId).html();return c==""?1:c},refreshPage:function(b){a.fn.bsgrid_paging.page(a.fn.bsgrid_paging.getCurPage(b),b)},firstPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c<=1){a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isFirstPage);return}a.fn.bsgrid_paging.page(1,b)},prevPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c<=1){if(b.settings.loopback&&b.totalPages>0){a.fn.bsgrid_paging.page(b.totalPages,b);return}else{a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isFirstPage);return}}a.fn.bsgrid_paging.page(parseInt(c)-1,b)},nextPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c>=b.totalPages){if(b.settings.loopback&&c>0){a.fn.bsgrid_paging.page(1,b);return}else{a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isLastPage);return}}a.fn.bsgrid_paging.page(parseInt(c)+1,b)},lastPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c>=b.totalPages){a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isLastPage);return}a.fn.bsgrid_paging.page(b.totalPages,b)},gotoPage:function(b,c){if(c==undefined){c=a("#"+b.gotoPageInputId).val()}if(a.trim(c)==""||isNaN(c)){a.fn.bsgrid_paging.alert(a.bsgridLanguage.needInteger)}else{if(parseInt(c)<1||parseInt(c)>b.totalPages){a.fn.bsgrid_paging.alert(a.bsgridLanguage.needRange(1,b.totalPages))}else{a("#"+b.gotoPageInputId).val(c);a.fn.bsgrid_paging.page(parseInt(c),b)}}},incorrectTurnAlert:function(b,c){if(b.settings.pageIncorrectTurnAlert){a.fn.bsgrid_paging.alert(c)}},alert:function(c){try{a.bsgrid.alert(c)}catch(b){alert(c)}},createPagingToolbar:function(b){var e=new StringBuilder();var c=b.settings.pagingLittleToolbar;e.append('");return e.toString()},setPagingToolbarEvents:function(b){if(b.settings.pageSizeSelect){a("#"+b.pageSizeId).change(function(){b.settings.pageSize=parseInt(a(this).val());a(this).trigger("blur");a.fn.bsgrid_paging.page(1,b)})}a("#"+b.firstPageId).click(function(){a.fn.bsgrid_paging.firstPage(b)});a("#"+b.prevPageId).click(function(){a.fn.bsgrid_paging.prevPage(b)});a("#"+b.nextPageId).click(function(){a.fn.bsgrid_paging.nextPage(b)});a("#"+b.lastPageId).click(function(){a.fn.bsgrid_paging.lastPage(b)});a("#"+b.gotoPageInputId).keyup(function(c){if(c.which==13){a.fn.bsgrid_paging.gotoPage(b)}});a("#"+b.gotoPageId).click(function(){a.fn.bsgrid_paging.gotoPage(b)});a("#"+b.refreshPageId).click(function(){a.fn.bsgrid_paging.refreshPage(b)})},dynamicChangePagingButtonStyle:function(b){var c="disabledCls";if(b.curPage<=1){a("#"+b.firstPageId).addClass(c);a("#"+b.prevPageId).addClass(c)}else{a("#"+b.firstPageId).removeClass(c);a("#"+b.prevPageId).removeClass(c)}if(b.curPage>=b.totalPages){a("#"+b.nextPageId).addClass(c);a("#"+b.lastPageId).addClass(c)}else{a("#"+b.nextPageId).removeClass(c);a("#"+b.lastPageId).removeClass(c)}},setPagingValues:function(i,g,f){i=Math.max(i,1);var b=f.settings.pageSize;var h=parseInt(g/b);h=parseInt((g%b==0)?h:h+1);var e=(i*b'+c+"")}a("#"+d.pageSizeId).html(f.toString()).val(d.settings.pageSize)}b.setPagingToolbarEvents();return b},getPagingObj:function(c){var b=a.fn.bsgrid_paging.pagingObjs[c];return b?b:null},page:function(c,b){var d=a.fn.bsgrid.getGridObj(b.settings.gridId);d.options.settings.pageSize=b.settings.pageSize;a.fn.bsgrid.page(c,d.options)},getCurPage:function(b){var c=a("#"+b.curPageId).html();return c==""?1:c},refreshPage:function(b){a.fn.bsgrid_paging.page(a.fn.bsgrid_paging.getCurPage(b),b)},firstPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c<=1){a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isFirstPage);return}a.fn.bsgrid_paging.page(1,b)},prevPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c<=1){if(b.settings.loopback&&b.totalPages>0){a.fn.bsgrid_paging.page(b.totalPages,b);return}else{a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isFirstPage);return}}a.fn.bsgrid_paging.page(parseInt(c)-1,b)},nextPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c>=b.totalPages){if(b.settings.loopback&&c>0){a.fn.bsgrid_paging.page(1,b);return}else{a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isLastPage);return}}a.fn.bsgrid_paging.page(parseInt(c)+1,b)},lastPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c>=b.totalPages){a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isLastPage);return}a.fn.bsgrid_paging.page(b.totalPages,b)},gotoPage:function(b,c){if(c==undefined){c=a("#"+b.gotoPageInputId).val()}if(a.trim(c)==""||isNaN(c)){a.fn.bsgrid_paging.alert(a.bsgridLanguage.needInteger)}else{if(parseInt(c)<1||parseInt(c)>b.totalPages){a.fn.bsgrid_paging.alert(a.bsgridLanguage.needRange(1,b.totalPages))}else{a("#"+b.gotoPageInputId).val(c);a.fn.bsgrid_paging.page(parseInt(c),b)}}},incorrectTurnAlert:function(b,c){if(b.settings.pageIncorrectTurnAlert){a.fn.bsgrid_paging.alert(c)}},alert:function(c){try{a.bsgrid.alert(c)}catch(b){alert(c)}},createPagingToolbar:function(b){var e=new StringBuilder();var c=b.settings.pagingLittleToolbar;e.append('");return e.toString()},setPagingToolbarEvents:function(b){if(b.settings.pageSizeSelect){a("#"+b.pageSizeId).change(function(){b.settings.pageSize=parseInt(a(this).val());a(this).trigger("blur");a.fn.bsgrid_paging.page(1,b)})}a("#"+b.firstPageId).click(function(){a.fn.bsgrid_paging.firstPage(b)});a("#"+b.prevPageId).click(function(){a.fn.bsgrid_paging.prevPage(b)});a("#"+b.nextPageId).click(function(){a.fn.bsgrid_paging.nextPage(b)});a("#"+b.lastPageId).click(function(){a.fn.bsgrid_paging.lastPage(b)});a("#"+b.gotoPageInputId).keyup(function(c){if(c.which==13){a.fn.bsgrid_paging.gotoPage(b)}});a("#"+b.gotoPageId).click(function(){a.fn.bsgrid_paging.gotoPage(b)});a("#"+b.refreshPageId).click(function(){a.fn.bsgrid_paging.refreshPage(b)})},dynamicChangePagingButtonStyle:function(b){var c="disabledCls";if(b.curPage<=1){a("#"+b.firstPageId).addClass(c);a("#"+b.prevPageId).addClass(c)}else{a("#"+b.firstPageId).removeClass(c);a("#"+b.prevPageId).removeClass(c)}if(b.curPage>=b.totalPages){a("#"+b.nextPageId).addClass(c);a("#"+b.lastPageId).addClass(c)}else{a("#"+b.nextPageId).removeClass(c);a("#"+b.lastPageId).removeClass(c)}},setPagingValues:function(i,g,f){i=Math.max(i,1);var b=f.settings.pageSize;var h=parseInt(g/b);h=parseInt((g%b==0)?h:h+1);var e=(i*bthis.length){return false}else{return this.substr(0,a.length)==a}};String.prototype.endWith=function(a){if(a==null||a==""||this.length==0||a.length>this.length){return false}else{return this.substring(this.length-a.length)==a}};String.prototype.replaceAll=function(a,b){return this.replace(new RegExp(a,"gm"),b)};function StringBuilder(){if(arguments.length){this.append.apply(this,arguments)}}StringBuilder.prototype=function(){var c=Array.prototype.join,d=Array.prototype.slice,a=/\{(\d+)\}/g,b=function(){return c.call(this,"")};return{constructor:StringBuilder,length:0,append:Array.prototype.push,appendFormat:function(e){var g=0,f=d.call(arguments,1);this.append(a.test(e)?e.replace(a,function(h,j){return f[j]}):e.replace(/\?/g,function(){return f[g++]}));return this},size:function(){return this.toString().length},toString:b,valueOf:b}}();
$.bsgrid={param:function(c,b){if(b==undefined){b=false}if(!b){return $.param(c)}var d=new StringBuilder();if(c instanceof Array){$.each(c,function(f,e){d.append("&"+e.name+"=");d.append(encodeURIComponent(encodeURIComponent(e.value)))})}else{for(var a in c){d.append("&"+a+"=");d.append(encodeURIComponent(encodeURIComponent(c[a])))}}return d.length>0?d.toString().substring(1):""},getKeysString:function(c,a){if(a==undefined){a=","}var d=new StringBuilder();if(c instanceof Array){$.each(c,function(f,e){if((d.toString()+a).indexOf(a+e.name+a)==-1){d.append(a+e.name)}})}else{for(var b in c){d.append(a+b)}}return d.length>0?d.toString().substring(1):""},forcePushPropertyInObject:function(b,a,c){if(b.hasOwnProperty(a)){b[a+"_f"]=c}else{b[a]=c}},adaptAttrOrProp:function(b,d,c){var a=parseInt($.fn.jquery.substring(0,$.fn.jquery.indexOf(".",2)).replace(".",""));if(c==undefined){if(a>=16){return b.prop(d)}else{return b.attr(d)}}else{if(a>=16){b.prop(d,c)}else{b.attr(d,c)}}},alert:function(a){alert(a)}};
-(function(a){a.fn.bsgrid_paging={defaults:{loopback:false,pageSize:20,pageSizeSelect:false,pageSizeForGrid:[5,10,20,25,50,100,200,500],pageIncorrectTurnAlert:true,pagingLittleToolbar:false,pagingBtnClass:"pagingBtn"},pagingObjs:{},init:function(h,g){var d={settings:a.extend(true,{},a.fn.bsgrid_paging.defaults,g),pagingId:h,totalRowsId:h+"_totalRows",totalPagesId:h+"_totalPages",curPageId:h+"_curPage",gotoPageInputId:h+"_gotoPageInput",gotoPageId:h+"_gotoPage",refreshPageId:h+"_refreshPage",pageSizeId:h+"_pageSize",firstPageId:h+"_firstPage",prevPageId:h+"_prevPage",nextPageId:h+"_nextPage",lastPageId:h+"_lastPage",startRowId:h+"_startRow",endRowId:h+"_endRow",totalRows:0,totalPages:0,curPage:1,curPageRowsNum:0,startRow:0,endRow:0};if(g.pageSizeForGrid!=undefined){d.settings.pageSizeForGrid=g.pageSizeForGrid}var b={options:d,page:function(i){a.fn.bsgrid_paging.page(i,d)},getCurPage:function(){return a.fn.bsgrid_paging.getCurPage(d)},refreshPage:function(){a.fn.bsgrid_paging.refreshPage(d)},firstPage:function(){a.fn.bsgrid_paging.firstPage(d)},prevPage:function(){a.fn.bsgrid_paging.prevPage(d)},nextPage:function(){a.fn.bsgrid_paging.nextPage(d)},lastPage:function(){a.fn.bsgrid_paging.lastPage(d)},gotoPage:function(i){a.fn.bsgrid_paging.gotoPage(d,i)},createPagingToolbar:function(){return a.fn.bsgrid_paging.createPagingToolbar(d)},setPagingToolbarEvents:function(){a.fn.bsgrid_paging.setPagingToolbarEvents(d)},dynamicChangePagingButtonStyle:function(){a.fn.bsgrid_paging.dynamicChangePagingButtonStyle(d)},setPagingValues:function(j,i){a.fn.bsgrid_paging.setPagingValues(j,i,d)}};a.fn.bsgrid_paging.pagingObjs[h]=b;a("#"+h).append(b.createPagingToolbar());if(d.settings.pageSizeSelect){if(a.inArray(d.settings.pageSize,d.settings.pageSizeForGrid)==-1){d.settings.pageSizeForGrid.push(d.settings.pageSize)}d.settings.pageSizeForGrid.sort(function(j,i){return j-i});var f=new StringBuilder();for(var e=0;e'+c+"")}a("#"+d.pageSizeId).html(f.toString()).val(d.settings.pageSize)}b.setPagingToolbarEvents();return b},getPagingObj:function(c){var b=a.fn.bsgrid_paging.pagingObjs[c];return b?b:null},page:function(c,b){var d=a.fn.bsgrid.getGridObj(b.settings.gridId);d.options.settings.pageSize=b.settings.pageSize;a.fn.bsgrid.page(c,d.options)},getCurPage:function(b){var c=a("#"+b.curPageId).html();return c==""?1:c},refreshPage:function(b){a.fn.bsgrid_paging.page(a.fn.bsgrid_paging.getCurPage(b),b)},firstPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c<=1){a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isFirstPage);return}a.fn.bsgrid_paging.page(1,b)},prevPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c<=1){if(b.settings.loopback&&b.totalPages>0){a.fn.bsgrid_paging.page(b.totalPages,b);return}else{a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isFirstPage);return}}a.fn.bsgrid_paging.page(parseInt(c)-1,b)},nextPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c>=b.totalPages){if(b.settings.loopback&&c>0){a.fn.bsgrid_paging.page(1,b);return}else{a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isLastPage);return}}a.fn.bsgrid_paging.page(parseInt(c)+1,b)},lastPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c>=b.totalPages){a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isLastPage);return}a.fn.bsgrid_paging.page(b.totalPages,b)},gotoPage:function(b,c){if(c==undefined){c=a("#"+b.gotoPageInputId).val()}if(a.trim(c)==""||isNaN(c)){a.fn.bsgrid_paging.alert(a.bsgridLanguage.needInteger)}else{if(parseInt(c)<1||parseInt(c)>b.totalPages){a.fn.bsgrid_paging.alert(a.bsgridLanguage.needRange(1,b.totalPages))}else{a("#"+b.gotoPageInputId).val(c);a.fn.bsgrid_paging.page(parseInt(c),b)}}},incorrectTurnAlert:function(b,c){if(b.settings.pageIncorrectTurnAlert){a.fn.bsgrid_paging.alert(c)}},alert:function(c){try{a.bsgrid.alert(c)}catch(b){alert(c)}},createPagingToolbar:function(b){var e=new StringBuilder();var c=b.settings.pagingLittleToolbar;e.append('");return e.toString()},setPagingToolbarEvents:function(b){if(b.settings.pageSizeSelect){a("#"+b.pageSizeId).change(function(){b.settings.pageSize=parseInt(a(this).val());a(this).trigger("blur");a.fn.bsgrid_paging.page(1,b)})}a("#"+b.firstPageId).click(function(){a.fn.bsgrid_paging.firstPage(b)});a("#"+b.prevPageId).click(function(){a.fn.bsgrid_paging.prevPage(b)});a("#"+b.nextPageId).click(function(){a.fn.bsgrid_paging.nextPage(b)});a("#"+b.lastPageId).click(function(){a.fn.bsgrid_paging.lastPage(b)});a("#"+b.gotoPageInputId).keyup(function(c){if(c.which==13){a.fn.bsgrid_paging.gotoPage(b)}});a("#"+b.gotoPageId).click(function(){a.fn.bsgrid_paging.gotoPage(b)});a("#"+b.refreshPageId).click(function(){a.fn.bsgrid_paging.refreshPage(b)})},dynamicChangePagingButtonStyle:function(b){var c="disabledCls";if(b.curPage<=1){a("#"+b.firstPageId).addClass(c);a("#"+b.prevPageId).addClass(c)}else{a("#"+b.firstPageId).removeClass(c);a("#"+b.prevPageId).removeClass(c)}if(b.curPage>=b.totalPages){a("#"+b.nextPageId).addClass(c);a("#"+b.lastPageId).addClass(c)}else{a("#"+b.nextPageId).removeClass(c);a("#"+b.lastPageId).removeClass(c)}},setPagingValues:function(i,g,f){i=Math.max(i,1);var b=f.settings.pageSize;var h=parseInt(g/b);h=parseInt((g%b==0)?h:h+1);var e=(i*b");$("#"+gridId).find("tr:lt("+($("#"+gridId+" tr").length-$("#"+gridId+" tfoot tr").length)+")").appendTo($("#"+gridId+" thead"))}if($("#"+gridId).find("tbody").length==0){$("#"+gridId+" thead").after("")}if($("#"+gridId).find("tfoot").length==0){$("#"+gridId).append('')}options.columnsModel=$.fn.bsgrid.initColumnsModel(options);if(settings.pageSizeForGrid!=undefined){options.settings.pageSizeForGrid=settings.pageSizeForGrid}options.settings.dataType=options.settings.dataType.toLowerCase();if(options.settings.pageSizeSelect){if($.inArray(options.settings.pageSize,options.settings.pageSizeForGrid)==-1){options.settings.pageSizeForGrid.push(options.settings.pageSize)}options.settings.pageSizeForGrid.sort(function(a,b){return a-b})}var gridObj={options:options,getPageCondition:function(curPage){return $.fn.bsgrid.getPageCondition(curPage,options)},page:function(curPage){$.fn.bsgrid.page(curPage,options)},search:function(params){$.fn.bsgrid.search(params,options)},loadGridData:function(dataType,gridData){$.fn.bsgrid.loadGridData(dataType,gridData,options)},getPageSize:function(){return options.settings.pageSize},getTotalRows:function(){return options.totalRows},getTotalPages:function(){return options.totalPages},getCurPage:function(){return options.curPage},getCurPageRowsNum:function(){return options.curPageRowsNum},getStartRow:function(){return options.startRow},getEndRow:function(){return options.endRow},getSortName:function(){return options.sortName},getSortOrder:function(){return options.sortOrder},getRows:function(){return $.fn.bsgrid.getRows(options)},getRow:function(row){return $.fn.bsgrid.getRow(row,options)},getRowCells:function(row){return $.fn.bsgrid.getRowCells(row,options)},getColCells:function(col){return $.fn.bsgrid.getColCells(col,options)},getCell:function(row,col){return $.fn.bsgrid.getCell(row,col,options)},getSelectedRow:function(){return $.fn.bsgrid.getSelectedRow(options)},getSelectedRowIndex:function(){return $.fn.bsgrid.getSelectedRowIndex(options)},selectRow:function(row){return $.fn.bsgrid.selectRow(row,options)},unSelectRow:function(){return $.fn.bsgrid.unSelectRow(options)},getUserdata:function(){return $.fn.bsgrid.getUserdata(options)},getRowRecord:function(rowObj){return $.fn.bsgrid.getRowRecord(rowObj)},getAllRecords:function(){return $.fn.bsgrid.getAllRecords(options)},getRecord:function(row){return $.fn.bsgrid.getRecord(row,options)},getRecordIndexValue:function(record,index){return $.fn.bsgrid.getRecordIndexValue(record,index,options)},getColumnValue:function(row,index){return $.fn.bsgrid.getColumnValue(row,index,options)},getCellRecordValue:function(row,col){return $.fn.bsgrid.getCellRecordValue(row,col,options)},sort:function(obj){$.fn.bsgrid.sort(obj,options)},getGridHeaderObject:function(){return $.fn.bsgrid.getGridHeaderObject(options)},getColumnModel:function(colIndex){return $.fn.bsgrid.getColumnModel(colIndex,options)},appendHeaderSort:function(){$.fn.bsgrid.appendHeaderSort(options)},setGridBlankBody:function(){$.fn.bsgrid.setGridBlankBody(options)},createPagingOutTab:function(){$.fn.bsgrid.createPagingOutTab(options)},clearGridBodyData:function(){$.fn.bsgrid.clearGridBodyData(options)},getPagingObj:function(){return $.fn.bsgrid.getPagingObj(options)},getCurPage:function(){return $.fn.bsgrid.getCurPage(options)},refreshPage:function(){$.fn.bsgrid.refreshPage(options)},firstPage:function(){$.fn.bsgrid.firstPage(options)},prevPage:function(){$.fn.bsgrid.prevPage(options)},nextPage:function(){$.fn.bsgrid.nextPage(options)},lastPage:function(){$.fn.bsgrid.lastPage(options)},gotoPage:function(goPage){$.fn.bsgrid.gotoPage(options,goPage)},initPaging:function(){return $.fn.bsgrid.initPaging(options)},setPagingValues:function(){$.fn.bsgrid.setPagingValues(options)}};$.fn.bsgrid.gridObjs[gridId]=gridObj;if(options.settings.pageAll||options.settings.pageSize<1){options.settings.pageAll=true;options.settings.pageSize=0}gridObj.appendHeaderSort();gridObj.createPagingOutTab();if(!options.settings.showPageToolbar){$("#"+options.pagingId).hide();$("#"+options.pagingOutTabId).hide()}if(!options.settings.pageAll){gridObj.pagingObj=gridObj.initPaging();try{var minWidth=$.trim($("#"+options.pagingId).children().width());minWidth=minWidth==""?0:parseInt(minWidth);if(minWidth!=0){$("#"+gridId).css("min-width",minWidth+16);$("#"+options.pagingOutTabId).css("min-width",minWidth+16)}$("#"+options.pagingOutTabId).width($("#"+gridId).width());$(window).resize(function(){$("#"+options.pagingOutTabId).width($("#"+gridId).width())})}catch(e){}}if(options.settings.isProcessLockScreen){$.fn.bsgrid.addLockScreen(options)}try{$.fn.bsgrid.extendInitGrid.initGridExtendOptions(gridId,options)}catch(e){}for(var key in options.settings.extend.initGridMethods){options.settings.extend.initGridMethods[key](gridId,options)}if(options.settings.autoLoad){setTimeout(function(){gridObj.page(1)},10)}else{gridObj.setGridBlankBody()}return gridObj},initColumnsModel:function(options){var columnsModel=[];$.fn.bsgrid.getGridHeaderObject(options).each(function(){var colsProperties=options.settings.colsProperties;var columnModel={};columnModel.sortName="";columnModel.sortOrder="";var sortInfo=$.trim($(this).attr(colsProperties.sortAttr));if(sortInfo.length!=0){var sortInfoArray=sortInfo.split(",");columnModel.sortName=$.trim(sortInfoArray[0]);columnModel.sortOrder=$.trim(sortInfoArray.length>1?sortInfoArray[1]:"")}columnModel.index=$.trim($(this).attr(colsProperties.indexAttr));columnModel.render=$.trim($(this).attr(colsProperties.renderAttr));columnModel.tip=$.trim($(this).attr(colsProperties.tipAttr));var maxLen=$.trim($(this).attr(colsProperties.lengthAttr));columnModel.maxLen=maxLen.length!=0?parseInt(maxLen):colsProperties.maxLength;var align=$.trim($(this).attr(colsProperties.alignAttr));columnModel.align=align==""?colsProperties.align:align;columnModel.hidden=$.trim($(this).attr(colsProperties.hiddenAttr));columnsModel.push(columnModel)});return columnsModel},getGridObj:function(gridId){var obj=$.fn.bsgrid.gridObjs[gridId];return obj?obj:null},buildData:{gridData:function(type,curPage,data){if(type=="json"){return $.fn.bsgrid.buildJsonData.gridData(curPage,data)}else{if(type=="xml"){return $.fn.bsgrid.buildXmlData.gridData(curPage,data)}}return false}},parseData:{success:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.success(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.success(gridData)}}return false},totalRows:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.totalRows(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.totalRows(gridData)}}return false},curPage:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.curPage(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.curPage(gridData)}}return false},data:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.data(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.data(gridData)}}return false},userdata:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.userdata(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.userdata(gridData)}}return false},getDataLen:function(type,gridData){if(type=="json"||type=="xml"){return $.fn.bsgrid.parseData.data(type,gridData).length}return 0},getRecord:function(type,data,row){if(type=="json"){return $.fn.bsgrid.parseJsonData.getRecord(data,row)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.getRecord(data,row)}}return false},getColumnValue:function(type,record,index){if(type=="json"){return $.fn.bsgrid.parseJsonData.getColumnValue(record,index)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.getColumnValue(record,index)}}return false}},buildJsonData:{gridData:function(curPage,data){return{success:true,totalRows:data.length,curPage:curPage,data:data}}},parseJsonData:{success:function(json){return json.success},totalRows:function(json){return json.totalRows},curPage:function(json){return json.curPage},data:function(json){return json.data},userdata:function(json){return json.userdata},getRecord:function(data,row){return data[row]},getColumnValue:function(record,index){return $.trim(record[index])}},buildXmlData:{gridData:function(curPage,data){return'true'+$(""+data+"").find("row").length+""+curPage+""+data+""}},parseXmlData:{success:function(xml){return $.trim($(xml).find("gridData success").text())=="true"},totalRows:function(xml){return parseInt($(xml).find("gridData totalRows").text())},curPage:function(xml){return parseInt($(xml).find("gridData curPage").text())},data:function(xml){return $(xml).find("gridData data row")},userdata:function(xml){return $(xml).find("gridData userdata")},getRecord:function(data,row){return data.eq(row)},getColumnValue:function(record,index){return $.trim(record.find(index).text())}},getPageCondition:function(curPage,options){var params=new StringBuilder();if(options.otherParames==false){}else{if((typeof options.otherParames).toLowerCase()=="string"||options.otherParames instanceof String){params.append("&"+options.otherParames)}else{if(options.otherParames instanceof Array){$.each(options.otherParames,function(i,objVal){params.append("&"+objVal.name+"="+objVal.value)})}else{for(var key in options.otherParames){params.append("&"+key+"="+options.otherParames[key])}}}}var condition=params.length==0?"":params.toString().substring(1);condition+=(condition.length==0?"":"&")+options.settings.requestParamsName.pageSize+"="+options.settings.pageSize+"&"+options.settings.requestParamsName.curPage+"="+curPage+"&"+options.settings.requestParamsName.sortName+"="+options.sortName+"&"+options.settings.requestParamsName.sortOrder+"="+options.sortOrder;return condition},search:function(params,options){options.otherParames=params;$.fn.bsgrid.page(1,options)},page:function(curPage,options){if($.trim(curPage)==""||isNaN(curPage)){$.fn.bsgrid.alert($.bsgridLanguage.needInteger);return}var dataType=options.settings.dataType;if(options.settings.localData!=false){if(dataType=="json"){$.fn.bsgrid.loadGridData(dataType,$.fn.bsgrid.buildData.gridData(dataType,curPage,options.settings.localData),options)}else{if(dataType=="xml"){$.fn.bsgrid.loadGridData(dataType,""+$.fn.bsgrid.buildData.gridData(dataType,curPage,options.settings.localData)+"",options)}}return}$.ajax({type:options.settings.ajaxType,url:options.settings.url,data:$.fn.bsgrid.getPageCondition(curPage,options),dataType:dataType,beforeSend:function(XMLHttpRequest){if(options.settings.isProcessLockScreen){$.fn.bsgrid.lockScreen(options)}options.settings.beforeSend(options,XMLHttpRequest)},complete:function(XMLHttpRequest,textStatus){options.settings.complete(options,XMLHttpRequest,textStatus);if(options.settings.isProcessLockScreen){$.fn.bsgrid.unlockScreen(options)}},success:function(gridData,textStatus){$.fn.bsgrid.loadGridData(dataType,gridData,options)},error:function(XMLHttpRequest,textStatus,errorThrown){$.fn.bsgrid.alert($.bsgridLanguage.errorForSendOrRequestData)}})},loadGridData:function(dataType,gridData,options){var parseSuccess=$.fn.bsgrid.parseData.success(dataType,gridData);for(var key in options.settings.extend.beforeRenderGridMethods){options.settings.extend.beforeRenderGridMethods[key](parseSuccess,gridData,options)}options.settings.additionalBeforeRenderGrid(parseSuccess,gridData,options);if(parseSuccess){var userdata=$.fn.bsgrid.parseData.userdata(dataType,gridData);$.fn.bsgrid.storeUserdata(userdata,options);options.settings.processUserdata(userdata,options);var totalRows=parseInt($.fn.bsgrid.parseData.totalRows(dataType,gridData));var curPage=parseInt($.fn.bsgrid.parseData.curPage(dataType,gridData));curPage=Math.max(curPage,1);if(options.settings.pageAll){curPage=1;options.settings.pageSize=totalRows;$("#"+options.noPagingationId).html(totalRows)}var pageSize=options.settings.pageSize;var totalPages=parseInt(totalRows/pageSize);totalPages=parseInt((totalRows%pageSize==0)?totalPages:totalPages+1);var curPageRowsNum=$.fn.bsgrid.parseData.getDataLen(dataType,gridData);curPageRowsNum=curPageRowsNum>pageSize?pageSize:curPageRowsNum;curPageRowsNum=(curPage*pageSize ';$(this).append(sortHtml).find(".sort").click(function(){$.fn.bsgrid.sort($(this).parent("th"),options)})}})},setGridBlankBody:function(options){$.fn.bsgrid.getRows(options).remove();var header=$.fn.bsgrid.getGridHeaderObject(options);var columnsModel=options.columnsModel;for(var hi=0;hi0){var trSb=new StringBuilder();trSb.append("");for(var hi=0;hi ")}trSb.append("
");rowSb=trSb.toString()}var rowsSb=new StringBuilder();var curPageRowsNum=options.settings.pageSize;if(!options.settings.displayBlankRows){curPageRowsNum=options.endRow-options.startRow+1;curPageRowsNum=options.endRow>0?curPageRowsNum:0}if(curPageRowsNum==0){rowsSb.append(''+$.bsgridLanguage.noDataToDisplay+" |
")}else{for(var pi=0;pi');if(options.settings.pageAll){pagingOutTabSb.append($.bsgridLanguage.noPagingation(options.noPagingationId)+" ")}pagingOutTabSb.append(" |
");$("#"+options.gridId).after(pagingOutTabSb.toString())},clearGridBodyData:function(options){$.fn.bsgrid.getRows(options).find("td").html(" ")},addLockScreen:function(options){if($(".bsgrid.lockscreen").length==0){var lockScreenHtml=new StringBuilder();lockScreenHtml.append('');lockScreenHtml.append("
");lockScreenHtml.append('');lockScreenHtml.append('
'+$.bsgridLanguage.loadingDataMessage+" |
");lockScreenHtml.append("
");$("body").append(lockScreenHtml.toString())}},lockScreen:function(options){$(".bsgrid.lockscreen").attr("times",parseInt($(".bsgrid.lockscreen").attr("times"))+1);if($(".bsgrid.lockscreen").css("display")=="none"){$(".bsgrid.lockscreen").show();$(".bsgrid.loading_div").show()}},unlockScreen:function(options){$(".bsgrid.lockscreen").attr("times",parseInt($(".bsgrid.lockscreen").attr("times"))-1);if($(".bsgrid.lockscreen").attr("times")=="0"){setTimeout(function(){$(".bsgrid.lockscreen").hide();$(".bsgrid.loading_div").hide()},50)}},columnTip:function(obj,value,record){$(obj).attr("title",value)},alert:function(msg){try{$.bsgrid.alert(msg)}catch(e){alert(msg)}},longLengthSubAndTip:function(obj,value,maxLen,record){var tip=false;if(value.length>maxLen){try{if(value.indexOf("<")<0||value.indexOf(">")<2||$(value).text().length==0){tip=true}}catch(e){tip=true}}if(tip){$(obj).html(value.substring(0,maxLen-3)+"...");$.fn.bsgrid.columnTip(obj,value,record)}else{$(obj).html(value)}},getPagingObj:function(options){return $.fn.bsgrid.getGridObj(options.gridId).pagingObj},getCurPage:function(options){return $.fn.bsgrid.getPagingObj(options).getCurPage()},refreshPage:function(options){if(!options.settings.pageAll){$.fn.bsgrid.getPagingObj(options).refreshPage()}else{$.fn.bsgrid.page(1,options)}},firstPage:function(options){$.fn.bsgrid.getPagingObj(options).firstPage()},prevPage:function(options){$.fn.bsgrid.getPagingObj(options).prevPage()},nextPage:function(options){$.fn.bsgrid.getPagingObj(options).nextPage()},lastPage:function(options){$.fn.bsgrid.getPagingObj(options).lastPage()},gotoPage:function(options,goPage){$.fn.bsgrid.getPagingObj(options).gotoPage(goPage)},initPaging:function(options){$("#"+options.pagingOutTabId+" td").attr("id",options.pagingId);return $.fn.bsgrid_paging.init(options.pagingId,{gridId:options.gridId,pageSize:options.settings.pageSize,pageSizeSelect:options.settings.pageSizeSelect,pageSizeForGrid:options.settings.pageSizeForGrid,pageIncorrectTurnAlert:options.settings.pageIncorrectTurnAlert,pagingLittleToolbar:options.settings.pagingLittleToolbar,pagingBtnClass:options.settings.pagingBtnClass})},setPagingValues:function(options){$.fn.bsgrid.getPagingObj(options).setPagingValues(options.curPage,options.totalRows)}}})(jQuery);
+(function(a){a.fn.bsgrid_paging={defaults:{loopback:false,pageSize:20,pageSizeSelect:false,pageSizeForGrid:[5,10,20,25,50,100,200,500],pageIncorrectTurnAlert:true,pagingLittleToolbar:false,pagingBtnClass:"pagingBtn",pagingMinWidth:"auto",pagingBtnShowState:{select:true,first:true,prev:true,next:true,last:true,gotoBtn:true,refresh:true}},pagingObjs:{},init:function(h,g){var d={settings:a.extend(true,{},a.fn.bsgrid_paging.defaults,g),pagingId:h,totalRowsId:h+"_totalRows",totalPagesId:h+"_totalPages",curPageId:h+"_curPage",gotoPageInputId:h+"_gotoPageInput",gotoPageId:h+"_gotoPage",refreshPageId:h+"_refreshPage",pageSizeId:h+"_pageSize",firstPageId:h+"_firstPage",prevPageId:h+"_prevPage",nextPageId:h+"_nextPage",lastPageId:h+"_lastPage",startRowId:h+"_startRow",endRowId:h+"_endRow",totalRows:0,totalPages:0,curPage:1,curPageRowsNum:0,startRow:0,endRow:0};if(g.pageSizeForGrid!=undefined){d.settings.pageSizeForGrid=g.pageSizeForGrid}var b={options:d,page:function(i){a.fn.bsgrid_paging.page(i,d)},getCurPage:function(){return a.fn.bsgrid_paging.getCurPage(d)},refreshPage:function(){a.fn.bsgrid_paging.refreshPage(d)},firstPage:function(){a.fn.bsgrid_paging.firstPage(d)},prevPage:function(){a.fn.bsgrid_paging.prevPage(d)},nextPage:function(){a.fn.bsgrid_paging.nextPage(d)},lastPage:function(){a.fn.bsgrid_paging.lastPage(d)},gotoPage:function(i){a.fn.bsgrid_paging.gotoPage(d,i)},createPagingToolbar:function(){return a.fn.bsgrid_paging.createPagingToolbar(d)},setPagingToolbarEvents:function(){a.fn.bsgrid_paging.setPagingToolbarEvents(d)},dynamicChangePagingButtonStyle:function(){a.fn.bsgrid_paging.dynamicChangePagingButtonStyle(d)},setPagingValues:function(j,i){a.fn.bsgrid_paging.setPagingValues(j,i,d)}};a.fn.bsgrid_paging.pagingObjs[h]=b;a("#"+h).append(b.createPagingToolbar());if(d.settings.pageSizeSelect){if(a.inArray(d.settings.pageSize,d.settings.pageSizeForGrid)==-1){d.settings.pageSizeForGrid.push(d.settings.pageSize)}d.settings.pageSizeForGrid.sort(function(j,i){return j-i});var f=new StringBuilder();for(var e=0;e'+c+"")}a("#"+d.pageSizeId).html(f.toString()).val(d.settings.pageSize)}b.setPagingToolbarEvents();return b},getPagingObj:function(c){var b=a.fn.bsgrid_paging.pagingObjs[c];return b?b:null},page:function(c,b){var d=a.fn.bsgrid.getGridObj(b.settings.gridId);d.options.settings.pageSize=b.settings.pageSize;a.fn.bsgrid.page(c,d.options)},getCurPage:function(b){var c=a("#"+b.curPageId).html();return c==""?1:c},refreshPage:function(b){a.fn.bsgrid_paging.page(a.fn.bsgrid_paging.getCurPage(b),b)},firstPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c<=1){a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isFirstPage);return}a.fn.bsgrid_paging.page(1,b)},prevPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c<=1){if(b.settings.loopback&&b.totalPages>0){a.fn.bsgrid_paging.page(b.totalPages,b);return}else{a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isFirstPage);return}}a.fn.bsgrid_paging.page(parseInt(c)-1,b)},nextPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c>=b.totalPages){if(b.settings.loopback&&c>0){a.fn.bsgrid_paging.page(1,b);return}else{a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isLastPage);return}}a.fn.bsgrid_paging.page(parseInt(c)+1,b)},lastPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c>=b.totalPages){a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isLastPage);return}a.fn.bsgrid_paging.page(b.totalPages,b)},gotoPage:function(b,c){if(c==undefined){c=a("#"+b.gotoPageInputId).val()}if(a.trim(c)==""||isNaN(c)){a.fn.bsgrid_paging.alert(a.bsgridLanguage.needInteger)}else{if(parseInt(c)<1||parseInt(c)>b.totalPages){a.fn.bsgrid_paging.alert(a.bsgridLanguage.needRange(1,b.totalPages))}else{a("#"+b.gotoPageInputId).val(c);a.fn.bsgrid_paging.page(parseInt(c),b)}}},incorrectTurnAlert:function(b,c){if(b.settings.pageIncorrectTurnAlert){a.fn.bsgrid_paging.alert(c)}},alert:function(c){try{a.bsgrid.alert(c)}catch(b){alert(c)}},createPagingToolbar:function(b){var e=new StringBuilder();var c=b.settings.pagingLittleToolbar;e.append('");return e.toString()},setPagingToolbarEvents:function(b){if(b.settings.pageSizeSelect){a("#"+b.pageSizeId).change(function(){b.settings.pageSize=parseInt(a(this).val());a(this).trigger("blur");a.fn.bsgrid_paging.page(1,b)})}a("#"+b.firstPageId).click(function(){a.fn.bsgrid_paging.firstPage(b)});a("#"+b.prevPageId).click(function(){a.fn.bsgrid_paging.prevPage(b)});a("#"+b.nextPageId).click(function(){a.fn.bsgrid_paging.nextPage(b)});a("#"+b.lastPageId).click(function(){a.fn.bsgrid_paging.lastPage(b)});a("#"+b.gotoPageInputId).keyup(function(c){if(c.which==13){a.fn.bsgrid_paging.gotoPage(b)}});a("#"+b.gotoPageId).click(function(){a.fn.bsgrid_paging.gotoPage(b)});a("#"+b.refreshPageId).click(function(){a.fn.bsgrid_paging.refreshPage(b)})},dynamicChangePagingButtonStyle:function(b){var c="disabledCls";if(b.curPage<=1){a("#"+b.firstPageId).addClass(c);a("#"+b.prevPageId).addClass(c)}else{a("#"+b.firstPageId).removeClass(c);a("#"+b.prevPageId).removeClass(c)}if(b.curPage>=b.totalPages){a("#"+b.nextPageId).addClass(c);a("#"+b.lastPageId).addClass(c)}else{a("#"+b.nextPageId).removeClass(c);a("#"+b.lastPageId).removeClass(c)}},setPagingValues:function(i,g,f){i=Math.max(i,1);var b=f.settings.pageSize;var h=parseInt(g/b);h=parseInt((g%b==0)?h:h+1);var e=(i*b");$("#"+gridId).find("tr:lt("+($("#"+gridId+" tr").length-$("#"+gridId+" tfoot tr").length)+")").appendTo($("#"+gridId+" thead"))}if($("#"+gridId).find("tbody").length==0){$("#"+gridId+" thead").after("")}if($("#"+gridId).find("tfoot").length==0){$("#"+gridId).append('')}options.columnsModel=$.fn.bsgrid.initColumnsModel(options);if(settings.pageSizeForGrid!=undefined){options.settings.pageSizeForGrid=settings.pageSizeForGrid}options.settings.dataType=options.settings.dataType.toLowerCase();if(options.settings.pageSizeSelect){if($.inArray(options.settings.pageSize,options.settings.pageSizeForGrid)==-1){options.settings.pageSizeForGrid.push(options.settings.pageSize)}options.settings.pageSizeForGrid.sort(function(a,b){return a-b})}var gridObj={options:options,getPageCondition:function(curPage){return $.fn.bsgrid.getPageCondition(curPage,options)},page:function(curPage){$.fn.bsgrid.page(curPage,options)},search:function(params){$.fn.bsgrid.search(params,options)},loadGridData:function(dataType,gridData){$.fn.bsgrid.loadGridData(dataType,gridData,options)},reloadLocalData:function(localData){$.fn.bsgrid.reloadLocalData(localData,options)},getPageSize:function(){return options.settings.pageSize},getTotalRows:function(){return options.totalRows},getTotalPages:function(){return options.totalPages},getCurPage:function(){return options.curPage},getCurPageRowsNum:function(){return options.curPageRowsNum},getStartRow:function(){return options.startRow},getEndRow:function(){return options.endRow},getSortName:function(){return options.sortName},getSortOrder:function(){return options.sortOrder},getRows:function(){return $.fn.bsgrid.getRows(options)},getRow:function(row){return $.fn.bsgrid.getRow(row,options)},getRowCells:function(row){return $.fn.bsgrid.getRowCells(row,options)},getColCells:function(col){return $.fn.bsgrid.getColCells(col,options)},getCell:function(row,col){return $.fn.bsgrid.getCell(row,col,options)},getSelectedRow:function(){return $.fn.bsgrid.getSelectedRow(options)},getSelectedRowIndex:function(){return $.fn.bsgrid.getSelectedRowIndex(options)},selectRow:function(row){return $.fn.bsgrid.selectRow(row,options)},unSelectRow:function(){return $.fn.bsgrid.unSelectRow(options)},getUserdata:function(){return $.fn.bsgrid.getUserdata(options)},getRowRecord:function(rowObj){return $.fn.bsgrid.getRowRecord(rowObj)},getAllRecords:function(){return $.fn.bsgrid.getAllRecords(options)},getRecord:function(row){return $.fn.bsgrid.getRecord(row,options)},getRecordIndexValue:function(record,index){return $.fn.bsgrid.getRecordIndexValue(record,index,options)},getColumnValue:function(row,index){return $.fn.bsgrid.getColumnValue(row,index,options)},getCellRecordValue:function(row,col){return $.fn.bsgrid.getCellRecordValue(row,col,options)},sort:function(obj){$.fn.bsgrid.sort(obj,options)},getGridHeaderObject:function(){return $.fn.bsgrid.getGridHeaderObject(options)},getColumnModel:function(colIndex){return $.fn.bsgrid.getColumnModel(colIndex,options)},appendHeaderSort:function(){$.fn.bsgrid.appendHeaderSort(options)},setGridBlankBody:function(){$.fn.bsgrid.setGridBlankBody(options)},createPagingOutTab:function(){$.fn.bsgrid.createPagingOutTab(options)},clearGridBodyData:function(){$.fn.bsgrid.clearGridBodyData(options)},getPagingObj:function(){return $.fn.bsgrid.getPagingObj(options)},getCurPage:function(){return $.fn.bsgrid.getCurPage(options)},refreshPage:function(){$.fn.bsgrid.refreshPage(options)},firstPage:function(){$.fn.bsgrid.firstPage(options)},prevPage:function(){$.fn.bsgrid.prevPage(options)},nextPage:function(){$.fn.bsgrid.nextPage(options)},lastPage:function(){$.fn.bsgrid.lastPage(options)},gotoPage:function(goPage){$.fn.bsgrid.gotoPage(options,goPage)},initPaging:function(){return $.fn.bsgrid.initPaging(options)},setPagingValues:function(){$.fn.bsgrid.setPagingValues(options)}};$.fn.bsgrid.gridObjs[gridId]=gridObj;if(options.settings.pageAll||options.settings.pageSize<1){options.settings.pageAll=true;options.settings.pageSize=0}gridObj.appendHeaderSort();gridObj.createPagingOutTab();if(!options.settings.showPageToolbar){$("#"+options.pagingId).hide();$("#"+options.pagingOutTabId).hide()}if(!options.settings.pageAll){gridObj.pagingObj=gridObj.initPaging();try{var minWidth=$.trim($("#"+options.pagingId).children().width());minWidth=minWidth==""?0:parseInt(minWidth);if(minWidth!=0){$("#"+gridId).css("min-width",minWidth+16);$("#"+options.pagingOutTabId).css("min-width",minWidth+16)}$("#"+options.pagingOutTabId).width($("#"+gridId).width());$(window).resize(function(){$("#"+options.pagingOutTabId).width($("#"+gridId).width())})}catch(e){}}if(options.settings.isProcessLockScreen){$.fn.bsgrid.addLockScreen(options)}try{$.fn.bsgrid.extendInitGrid.initGridExtendOptions(gridId,options)}catch(e){}for(var key in options.settings.extend.initGridMethods){options.settings.extend.initGridMethods[key](gridId,options)}if(options.settings.autoLoad){setTimeout(function(){gridObj.page(1)},10)}else{gridObj.setGridBlankBody()}return gridObj},initColumnsModel:function(options){var columnsModel=[];$.fn.bsgrid.getGridHeaderObject(options).each(function(){var colsProperties=options.settings.colsProperties;var columnModel={};columnModel.sortName="";columnModel.sortOrder="";var sortInfo=$.trim($(this).attr(colsProperties.sortAttr));if(sortInfo.length!=0){var sortInfoArray=sortInfo.split(",");columnModel.sortName=$.trim(sortInfoArray[0]);columnModel.sortOrder=$.trim(sortInfoArray.length>1?sortInfoArray[1]:"")}columnModel.index=$.trim($(this).attr(colsProperties.indexAttr));columnModel.render=$.trim($(this).attr(colsProperties.renderAttr));columnModel.tip=$.trim($(this).attr(colsProperties.tipAttr));var maxLen=$.trim($(this).attr(colsProperties.lengthAttr));columnModel.maxLen=maxLen.length!=0?parseInt(maxLen):colsProperties.maxLength;var align=$.trim($(this).attr(colsProperties.alignAttr));columnModel.align=align==""?colsProperties.align:align;columnModel.hidden=$.trim($(this).attr(colsProperties.hiddenAttr));columnsModel.push(columnModel)});return columnsModel},getGridObj:function(gridId){var obj=$.fn.bsgrid.gridObjs[gridId];return obj?obj:null},buildData:{gridData:function(type,curPage,data){if(type=="json"){return $.fn.bsgrid.buildJsonData.gridData(curPage,data)}else{if(type=="xml"){return $.fn.bsgrid.buildXmlData.gridData(curPage,data)}}return false}},parseData:{success:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.success(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.success(gridData)}}return false},totalRows:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.totalRows(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.totalRows(gridData)}}return false},curPage:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.curPage(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.curPage(gridData)}}return false},data:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.data(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.data(gridData)}}return false},userdata:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.userdata(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.userdata(gridData)}}return false},getDataLen:function(type,gridData){if(type=="json"||type=="xml"){return $.fn.bsgrid.parseData.data(type,gridData).length}return 0},getRecord:function(type,data,row){if(type=="json"){return $.fn.bsgrid.parseJsonData.getRecord(data,row)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.getRecord(data,row)}}return false},getColumnValue:function(type,record,index){if(type=="json"){return $.fn.bsgrid.parseJsonData.getColumnValue(record,index)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.getColumnValue(record,index)}}return false}},buildJsonData:{gridData:function(curPage,data){return{success:true,totalRows:data.length,curPage:curPage,data:data}}},parseJsonData:{success:function(json){return json.success},totalRows:function(json){return json.totalRows},curPage:function(json){return json.curPage},data:function(json){return json.data},userdata:function(json){return json.userdata},getRecord:function(data,row){return data[row]},getColumnValue:function(record,index){return $.trim(record[index])}},buildXmlData:{gridData:function(curPage,data){return'true'+$(""+data+"").find("row").length+""+curPage+""+data+""}},parseXmlData:{success:function(xml){return $.trim($(xml).find("gridData success").text())=="true"},totalRows:function(xml){return parseInt($(xml).find("gridData totalRows").text())},curPage:function(xml){return parseInt($(xml).find("gridData curPage").text())},data:function(xml){return $(xml).find("gridData data row")},userdata:function(xml){return $(xml).find("gridData userdata")},getRecord:function(data,row){return data.eq(row)},getColumnValue:function(record,index){return $.trim(record.find(index).text())}},getPageCondition:function(curPage,options){var params=new StringBuilder();if(options.otherParames==false){}else{if((typeof options.otherParames).toLowerCase()=="string"||options.otherParames instanceof String){params.append("&"+options.otherParames)}else{if(options.otherParames instanceof Array){$.each(options.otherParames,function(i,objVal){params.append("&"+objVal.name+"="+objVal.value)})}else{for(var key in options.otherParames){params.append("&"+key+"="+options.otherParames[key])}}}}var condition=params.length==0?"":params.toString().substring(1);condition+=(condition.length==0?"":"&")+options.settings.requestParamsName.pageSize+"="+options.settings.pageSize+"&"+options.settings.requestParamsName.curPage+"="+curPage+"&"+options.settings.requestParamsName.sortName+"="+options.sortName+"&"+options.settings.requestParamsName.sortOrder+"="+options.sortOrder;return condition},search:function(params,options){if(params!=undefined){options.otherParames=params}else{options.otherParames=false}$.fn.bsgrid.page(1,options)},page:function(curPage,options){if($.trim(curPage)==""||isNaN(curPage)){$.fn.bsgrid.alert($.bsgridLanguage.needInteger);return}var dataType=options.settings.dataType;if(options.settings.localData!=false){if(dataType=="json"){$.fn.bsgrid.loadGridData(dataType,$.fn.bsgrid.buildData.gridData(dataType,curPage,options.settings.localData),options)}else{if(dataType=="xml"){$.fn.bsgrid.loadGridData(dataType,""+$.fn.bsgrid.buildData.gridData(dataType,curPage,options.settings.localData)+"",options)}}return}$.ajax({type:options.settings.ajaxType,url:options.settings.url,data:$.fn.bsgrid.getPageCondition(curPage,options),dataType:dataType,beforeSend:function(XMLHttpRequest){if(options.settings.isProcessLockScreen){$.fn.bsgrid.lockScreen(options)}options.settings.beforeSend(options,XMLHttpRequest)},complete:function(XMLHttpRequest,textStatus){options.settings.complete(options,XMLHttpRequest,textStatus);if(options.settings.isProcessLockScreen){$.fn.bsgrid.unlockScreen(options)}},success:function(gridData,textStatus){$.fn.bsgrid.loadGridData(dataType,gridData,options)},error:function(XMLHttpRequest,textStatus,errorThrown){$.fn.bsgrid.alert($.bsgridLanguage.errorForSendOrRequestData)}})},loadGridData:function(dataType,gridData,options){var parseSuccess=$.fn.bsgrid.parseData.success(dataType,gridData);for(var key in options.settings.extend.beforeRenderGridMethods){options.settings.extend.beforeRenderGridMethods[key](parseSuccess,gridData,options)}options.settings.additionalBeforeRenderGrid(parseSuccess,gridData,options);if(parseSuccess){var userdata=$.fn.bsgrid.parseData.userdata(dataType,gridData);$.fn.bsgrid.storeUserdata(userdata,options);options.settings.processUserdata(userdata,options);var totalRows=parseInt($.fn.bsgrid.parseData.totalRows(dataType,gridData));var curPage=parseInt($.fn.bsgrid.parseData.curPage(dataType,gridData));curPage=Math.max(curPage,1);if(options.settings.pageAll){curPage=1;options.settings.pageSize=totalRows;$("#"+options.noPagingationId).html(totalRows)}var pageSize=options.settings.pageSize;var totalPages=parseInt(totalRows/pageSize);totalPages=parseInt((totalRows%pageSize==0)?totalPages:totalPages+1);var curPageRowsNum=$.fn.bsgrid.parseData.getDataLen(dataType,gridData);curPageRowsNum=curPageRowsNum>pageSize?pageSize:curPageRowsNum;curPageRowsNum=(curPage*pageSize ';$(this).append(sortHtml).find(".sort").click(function(){$.fn.bsgrid.sort($(this).parent("th"),options)})}})},setGridBlankBody:function(options){$.fn.bsgrid.getRows(options).remove();var header=$.fn.bsgrid.getGridHeaderObject(options);var columnsModel=options.columnsModel;for(var hi=0;hi0){var trSb=new StringBuilder();trSb.append("");for(var hi=0;hi ")}trSb.append("
");rowSb=trSb.toString()}var rowsSb=new StringBuilder();var curPageRowsNum=options.settings.pageSize;if(!options.settings.displayBlankRows){curPageRowsNum=options.endRow-options.startRow+1;curPageRowsNum=options.endRow>0?curPageRowsNum:0}if(curPageRowsNum==0){rowsSb.append(''+$.bsgridLanguage.noDataToDisplay+" |
")}else{for(var pi=0;pi');if(options.settings.pageAll){pagingOutTabSb.append($.bsgridLanguage.noPagingation(options.noPagingationId)+" ")}pagingOutTabSb.append(" |
");$("#"+options.gridId).after(pagingOutTabSb.toString())},clearGridBodyData:function(options){$.fn.bsgrid.getRows(options).find("td").html(" ")},addLockScreen:function(options){if($(".bsgrid.lockscreen").length==0){var lockScreenHtml=new StringBuilder();lockScreenHtml.append('');lockScreenHtml.append("
");lockScreenHtml.append('');lockScreenHtml.append('
'+$.bsgridLanguage.loadingDataMessage+" |
");lockScreenHtml.append("
");$("body").append(lockScreenHtml.toString())}},lockScreen:function(options){$(".bsgrid.lockscreen").attr("times",parseInt($(".bsgrid.lockscreen").attr("times"))+1);if($(".bsgrid.lockscreen").css("display")=="none"){$(".bsgrid.lockscreen").show();$(".bsgrid.loading_div").show()}},unlockScreen:function(options){$(".bsgrid.lockscreen").attr("times",parseInt($(".bsgrid.lockscreen").attr("times"))-1);if($(".bsgrid.lockscreen").attr("times")=="0"){setTimeout(function(){$(".bsgrid.lockscreen").hide();$(".bsgrid.loading_div").hide()},50)}},columnTip:function(obj,value,record){$(obj).attr("title",value)},alert:function(msg){try{$.bsgrid.alert(msg)}catch(e){alert(msg)}},longLengthSubAndTip:function(obj,value,maxLen,record){var tip=false;if(value.length>maxLen){try{if(value.indexOf("<")<0||value.indexOf(">")<2||$(value).text().length==0){tip=true}}catch(e){tip=true}}if(tip){$(obj).html(value.substring(0,maxLen-3)+"...");$.fn.bsgrid.columnTip(obj,value,record)}else{$(obj).html(value)}},getPagingObj:function(options){return $.fn.bsgrid.getGridObj(options.gridId).pagingObj},getCurPage:function(options){return $.fn.bsgrid.getPagingObj(options).getCurPage()},refreshPage:function(options){if(!options.settings.pageAll){$.fn.bsgrid.getPagingObj(options).refreshPage()}else{$.fn.bsgrid.page(1,options)}},firstPage:function(options){$.fn.bsgrid.getPagingObj(options).firstPage()},prevPage:function(options){$.fn.bsgrid.getPagingObj(options).prevPage()},nextPage:function(options){$.fn.bsgrid.getPagingObj(options).nextPage()},lastPage:function(options){$.fn.bsgrid.getPagingObj(options).lastPage()},gotoPage:function(options,goPage){$.fn.bsgrid.getPagingObj(options).gotoPage(goPage)},initPaging:function(options){$("#"+options.pagingOutTabId+" td").attr("id",options.pagingId);return $.fn.bsgrid_paging.init(options.pagingId,{gridId:options.gridId,pageSize:options.settings.pageSize,pageSizeSelect:options.settings.pageSizeSelect,pageSizeForGrid:options.settings.pageSizeForGrid,pageIncorrectTurnAlert:options.settings.pageIncorrectTurnAlert,pagingLittleToolbar:options.settings.pagingLittleToolbar,pagingBtnClass:options.settings.pagingBtnClass})},setPagingValues:function(options){$.fn.bsgrid.getPagingObj(options).setPagingValues(options.curPage,options.totalRows)}}})(jQuery);
(function($){$.fn.bsgrid.defaults.extend.settings={supportGridEdit:false,supportGridEditTriggerEvent:"rowClick",supportColumnMove:false,searchConditionsContainerId:"",fixedGridHeader:false,fixedGridHeight:"320px",gridEditConfigs:{text:{build:function(edit,value,record,rowIndex,colIndex,tdObj,trObj,options){return value+''},val:function(formObj){return formObj.val()}},checkbox:{build:function(edit,value,record,rowIndex,colIndex,tdObj,trObj,options){return value+''},val:function(formObj){return formObj.val()}},textarea:{build:function(edit,value,record,rowIndex,colIndex,tdObj,trObj,options){return value+'"},val:function(formObj){return formObj.val()}}}};$.fn.bsgrid.defaults.extend.settings.gridEditConfigs.hidden=$.fn.bsgrid.defaults.extend.settings.gridEditConfigs.text;$.fn.bsgrid.defaults.extend.settings.gridEditConfigs.password=$.fn.bsgrid.defaults.extend.settings.gridEditConfigs.text;$.fn.bsgrid.defaults.extend.settings.gridEditConfigs.radio=$.fn.bsgrid.defaults.extend.settings.gridEditConfigs.text;$.fn.bsgrid.defaults.extend.settings.gridEditConfigs.button=$.fn.bsgrid.defaults.extend.settings.gridEditConfigs.text;$.extend(true,$.fn.bsgrid.defaults.colsProperties,{lineNumberAttr:"w_num",checkAttr:"w_check",editAttr:"w_edit",aggAttr:"w_agg"});$.fn.bsgrid.defaults.event.customCellEditEvents={};$.fn.bsgrid.extendInitGrid={};$.fn.bsgrid.extendBeforeRenderGrid={};$.fn.bsgrid.extendRenderPerRow={};$.fn.bsgrid.extendRenderPerColumn={};$.fn.bsgrid.extendAfterRenderGrid={};$.fn.bsgrid.extendOtherMethods={};$.fn.bsgrid.extendInitGrid.initGridExtendOptions=function(gridId,options){var columnsModel=options.columnsModel;var colsProperties=options.settings.colsProperties;$.fn.bsgrid.getGridHeaderObject(options).each(function(i){columnsModel[i].lineNumber=$.trim($(this).attr(colsProperties.lineNumberAttr));columnsModel[i].check=$.trim($(this).attr(colsProperties.checkAttr));columnsModel[i].edit=$.trim($(this).attr(colsProperties.editAttr))});if($("#"+options.gridId+" tfoot tr td["+colsProperties.aggAttr+"!='']").length!=0){$("#"+options.gridId+" tfoot tr td").each(function(i){columnsModel[i].aggName="";columnsModel[i].aggIndex="";var aggInfo=$.trim($(this).attr(colsProperties.aggAttr));if(aggInfo.length!=0){var aggInfoArray=aggInfo.split(",");columnsModel[i].aggName=aggInfoArray[0].toLocaleLowerCase();columnsModel[i].aggIndex=aggInfoArray.length>1?aggInfoArray[1]:""}})}if($.fn.bsgrid.getGridHeaderObject(options).filter("["+colsProperties.lineNumberAttr+"$='line']").length!=0){options.settings.extend.afterRenderGridMethods.renderLineNumber=$.fn.bsgrid.extendAfterRenderGrid.renderLineNumber}if($.fn.bsgrid.getGridHeaderObject(options).filter("["+colsProperties.checkAttr+"='true']").length!=0){options.settings.extend.initGridMethods.initGridCheck=$.fn.bsgrid.extendInitGrid.initGridCheck;options.settings.extend.renderPerColumnMethods.renderCheck=$.fn.bsgrid.extendRenderPerColumn.renderCheck;options.settings.extend.afterRenderGridMethods.addCheckChangedEvent=$.fn.bsgrid.extendAfterRenderGrid.addCheckChangedEvent}if(options.settings.extend.settings.supportGridEdit){options.settings.extend.renderPerColumnMethods.renderForm=$.fn.bsgrid.extendRenderPerColumn.renderForm;options.settings.extend.afterRenderGridMethods.addGridEditEvent=$.fn.bsgrid.extendAfterRenderGrid.addGridEditEvent;var gridObj=$.fn.bsgrid.getGridObj(gridId);gridObj.activeGridEditMode=function(){return $.fn.bsgrid.defaults.extend.activeGridEditMode(options)};gridObj.getChangedRowsIndexs=function(){return $.fn.bsgrid.defaults.extend.getChangedRowsIndexs(options)};gridObj.getChangedRowsOldRecords=function(){return $.fn.bsgrid.defaults.extend.getChangedRowsOldRecords(options)};gridObj.getRowsChangedColumnsValue=function(){return $.fn.bsgrid.defaults.extend.getRowsChangedColumnsValue(options)};gridObj.deleteRow=function(row){$.fn.bsgrid.defaults.extend.deleteRow(row,options)};gridObj.addNewEditRow=function(){$.fn.bsgrid.defaults.extend.addNewEditRow(options)}}if(options.settings.extend.settings.supportColumnMove){options.settings.extend.initGridMethods.initColumnMove=$.fn.bsgrid.extendInitGrid.initColumnMove}if(options.settings.extend.settings.fixedGridHeader){options.settings.extend.initGridMethods.initFixedHeader=$.fn.bsgrid.extendOtherMethods.initFixedHeader;options.settings.extend.afterRenderGridMethods.fixedHeader=function(parseSuccess,gridData,options){$.fn.bsgrid.extendOtherMethods.fixedHeader(false,options)}}if($.trim(options.settings.extend.settings.searchConditionsContainerId)!=""){options.settings.extend.initGridMethods.initSearchConditions=$.fn.bsgrid.extendInitGrid.initSearchConditions}if($("#"+options.gridId+" tfoot td["+colsProperties.aggAttr+"!='']").length!=0){options.settings.extend.afterRenderGridMethods.aggregation=$.fn.bsgrid.extendAfterRenderGrid.aggregation}};$.fn.bsgrid.extendInitGrid.initGridCheck=function(gridId,options){$.fn.bsgrid.getGridHeaderObject(options).each(function(hi){if(options.columnsModel[hi].check=="true"){if($.trim($(this).html())==""){$(this).html('')}$(this).find("input[type=checkbox]").change(function(){var checked=$.bsgrid.adaptAttrOrProp($(this),"checked")?true:false;$.bsgrid.adaptAttrOrProp($.fn.bsgrid.getRows(options).find("td:nth-child("+(hi+1)+")>input[type=checkbox]"),"checked",checked)})}});var gridObj=$.fn.bsgrid.getGridObj(gridId);gridObj.getCheckedRowsIndexs=function(){return $.fn.bsgrid.defaults.extend.getCheckedRowsIndexs(options)};gridObj.getCheckedRowsRecords=function(){return $.fn.bsgrid.defaults.extend.getCheckedRowsRecords(options)};gridObj.getCheckedValues=function(index){return $.fn.bsgrid.defaults.extend.getCheckedValues(index,options)}};$.fn.bsgrid.extendInitGrid.initSearchConditions=function(gridId,options){var conditionsHtml=new StringBuilder();conditionsHtml.append('");conditionsHtml.append(" ");conditionsHtml.append('');$("#"+options.settings.extend.settings.searchConditionsContainerId).html(conditionsHtml.toString());$("#"+options.settings.extend.settings.searchConditionsContainerId+" select.bsgrid_conditions_select").change(function(){$(this).next("input.bsgrid_conditions_input").attr("name",$(this).val())}).trigger("change")};$.fn.bsgrid.extendInitGrid.initColumnMove=function(gridId,options){if($("#"+options.gridId+" thead tr").length!=1){return}$("#"+options.gridId).css({"table-layout":"fixed"});var headObj=$.fn.bsgrid.getGridHeaderObject(options);var headLen=headObj.length;headObj.each(function(i){var obj=this;$(obj).bind("selectstart",function(){return false});$(obj).css("-moz-user-select","none");$(obj).mousedown(function(){bindDownData(obj,i,headLen)});$(obj).mousemove(function(e){e=e||event;var left=$(obj).offset().left;var nObj=0,nLeft=0;if(i!=headLen-1){nObj=$(obj).next();nLeft=nObj.offset().left}var mObj=obj;if(i!=headLen-1&&e.clientX-nLeft>-10){mObj=nObj}if((i!=0&&e.clientX-left<10)||(i!=headLen-1&&e.clientX-nLeft>-10)){$(obj).css({cursor:"e-resize"});if($.trim($(obj).data("ex_mousedown"))!="mousedown"){return}var mWidth=$(mObj).width();var newMWidth=mWidth-e.clientX+$(mObj).offset().left;var preMWidth=$(mObj).prev().width();var preNewMWidth=preMWidth+e.clientX-$(mObj).offset().left;if(parseInt(newMWidth)>19&&parseInt(preNewMWidth)>19){$(mObj).width(newMWidth).prev().width(preNewMWidth)}}else{$(mObj).css({cursor:"default"});releaseDownData(obj,i,headLen)}});$(obj).mouseup(function(){releaseDownData(obj,i,headLen)});$(obj).mouseout(function(e){e=e||event;var objOffect=$(obj).offset();if(objOffect.top>e.clientY||objOffect.top+$(obj).height()'}}return false};$.fn.bsgrid.extendRenderPerColumn.renderForm=function(record,rowIndex,colIndex,tdObj,trObj,options){if(rowIndexinput[type=checkbox]");checkboxObjs.change(function(){var allCheckboxObjs=$.fn.bsgrid.getRows(options).find("td:nth-child("+(hi+1)+")>input[type=checkbox]");var checked=$.bsgrid.adaptAttrOrProp(checkboxObj,"checked")?true:false;if(!checked&&allCheckboxObjs.filter(":checked").length==allCheckboxObjs.length){$.bsgrid.adaptAttrOrProp(checkboxObj,"checked",true)}else{if(checked&&allCheckboxObjs.filter(":checked").length!=allCheckboxObjs.length){$.bsgrid.adaptAttrOrProp(checkboxObj,"checked",false)}}})}})};$.fn.bsgrid.extendAfterRenderGrid.addGridEditEvent=function(parseSuccess,gridData,options){var gridObj=$.fn.bsgrid.getGridObj(options.gridId);$.fn.bsgrid.getRows(options).filter(":lt("+options.curPageRowsNum+")").each(function(){var columnsModel=options.columnsModel;$(this).find("td").each(function(ci){if(columnsModel[ci].edit!=""){$(this).find(":input").change(function(){var rowObj=$(this).parent("td").parent("tr");var isNew=$.trim(rowObj.data("new"));var value=(isNew=="true"?"":gridObj.getRecordIndexValue(gridObj.getRowRecord(rowObj),columnsModel[ci].index));if($.trim($(this).val())!=value){$(this).addClass("bsgrid_editgrid_change")}else{$(this).removeClass("bsgrid_editgrid_change")}rowObj.data("change",rowObj.find(".bsgrid_editgrid_change").length)})}});if(options.settings.extend.settings.supportGridEditTriggerEvent==""){$(this).find(".bsgrid_editgrid_hidden").each(function(){showCellEdit(this)})}else{if(options.settings.extend.settings.supportGridEditTriggerEvent=="rowClick"){$(this).click(function(){$(this).find(".bsgrid_editgrid_hidden").each(function(){showCellEdit(this)})})}else{if(options.settings.extend.settings.supportGridEditTriggerEvent=="rowDoubleClick"){$(this).dblclick(function(){$(this).find(".bsgrid_editgrid_hidden").each(function(){showCellEdit(this)})})}else{if(options.settings.extend.settings.supportGridEditTriggerEvent=="cellClick"){$(this).find(".bsgrid_editgrid_hidden").each(function(){var formObj=this;$(formObj).parent("td").click(function(){showCellEdit(formObj)})})}else{if(options.settings.extend.settings.supportGridEditTriggerEvent=="cellDoubleClick"){$(this).find(".bsgrid_editgrid_hidden").each(function(){var formObj=this;$(formObj).parent("td").dblclick(function(){showCellEdit(formObj)})})}}}}}});function showCellEdit(formObj){var cloneObj=$(formObj).removeClass("bsgrid_editgrid_hidden").clone(true);$(formObj).parent("td").html(cloneObj)}};$.fn.bsgrid.extendAfterRenderGrid.aggregation=function(parseSuccess,gridData,options){var gridObj=$.fn.bsgrid.getGridObj(options.gridId);var columnsModel=options.columnsModel;$("#"+options.gridId+" tfoot tr td["+options.settings.colsProperties.aggAttr+"!='']").each(function(i){if(columnsModel[i].aggName!=""){var aggName=columnsModel[i].aggName;var val=null;if(aggName=="count"){val=options.curPageRowsNum}else{if(aggName=="countnotnone"||aggName=="sum"||aggName=="avg"||aggName=="max"||aggName=="min"||aggName=="concat"){if(aggName=="countnotnone"){val=0}var valHtml=new StringBuilder();$.fn.bsgrid.getRows(options).filter(":lt("+options.curPageRowsNum+")").each(function(ri){var rval=gridObj.getColumnValue(ri,columnsModel[i].aggIndex);if(rval==""){}else{if(aggName=="countnotnone"){val=(val==null?0:val)+1}else{if(aggName=="sum"||aggName=="avg"){if(!isNaN(rval)){val=(val==null?0:val)+parseFloat(rval)}}else{if(aggName=="max"||aggName=="min"){if(!isNaN(rval)&&(val==null||(aggName=="max"&&parseFloat(rval)>val)||(aggName=="min"&&parseFloat(rval)input:checked").length==1){rowIndexs[rowIndexs.length]=i}});return rowIndexs};$.fn.bsgrid.defaults.extend.getCheckedRowsRecords=function(options){var records=[];$.each($.fn.bsgrid.defaults.extend.getCheckedRowsIndexs(options),function(i,rowIndex){records[records.length]=$.fn.bsgrid.getRecord(rowIndex,options)});return records};$.fn.bsgrid.defaults.extend.getCheckedValues=function(index,options){var values=[];$.each($.fn.bsgrid.defaults.extend.getCheckedRowsRecords(options),function(i,record){values[values.length]=$.fn.bsgrid.getRecordIndexValue(record,index,options)});return values};$.fn.bsgrid.defaults.extend.activeGridEditMode=function(options){if(!options.settings.extend.settings.supportGridEdit){return}$.fn.bsgrid.getRows(options).filter(":lt("+options.curPageRowsNum+")").find("td .bsgrid_editgrid_hidden").each(function(){var cloneObj=$(this).removeClass("bsgrid_editgrid_hidden").clone(true);$(this).parent("td").html(cloneObj)})};$.fn.bsgrid.defaults.extend.getChangedRowsIndexs=function(options){var rowIndexs=[];$.fn.bsgrid.getRows(options).each(function(i){var cellChangedNumStr=$.trim($(this).data("change"));if(!isNaN(cellChangedNumStr)&&parseInt(cellChangedNumStr)>0){rowIndexs[rowIndexs.length]=i}});return rowIndexs};$.fn.bsgrid.defaults.extend.getChangedRowsOldRecords=function(options){var records=[];$.each($.fn.bsgrid.defaults.extend.getChangedRowsIndexs(options),function(i,rowIndex){records[records.length]=$.fn.bsgrid.getRecord(rowIndex,options)});return records};$.fn.bsgrid.defaults.extend.getRowsChangedColumnsValue=function(options){var values={};$.each($.fn.bsgrid.defaults.extend.getChangedRowsIndexs(options),function(i,rowIndex){values["row_"+rowIndex]={};$.fn.bsgrid.getRows(options).filter(":eq("+rowIndex+")").find("td").each(function(ci){if($(this).find(".bsgrid_editgrid_change").length>0){values["row_"+rowIndex][options.columnsModel[ci].index]=options.settings.extend.settings.gridEditConfigs[options.columnsModel[ci].edit].val($(this).find(".bsgrid_editgrid_change"))}})});return values};$.fn.bsgrid.defaults.extend.deleteRow=function(row,options){$.fn.bsgrid.getRow(row,options).remove()};$.fn.bsgrid.defaults.extend.addNewEditRow=function(options){var gridObj=$.fn.bsgrid.getGridObj(options.gridId);if(gridObj.getRows().length<1){return}$("#"+options.gridId+" tbody").prepend(gridObj.getRow(0).clone(true));gridObj.getRowCells(0).each(function(colIndex){var columnModel=options.columnsModel[colIndex];if(columnModel.render!=""){var render_method=eval(columnModel.render);var render_html=render_method(null,0,colIndex,options);$(this).html(render_html)}else{if(columnModel.edit!="textarea"){$(this).children().val("")}else{$(this).children().text("")}$(this).html($(this).children().removeClass("bsgrid_editgrid_change").clone(true)).removeAttr("title")}});gridObj.getRow(0).data("record",null).data("new","true")};$.fn.bsgrid.extendOtherMethods.fixedHeader=function(iFirst,options){if($.trim($("#"+options.gridId+"_fixedDiv").data("fixedGridLock"))=="lock"){return}$("#"+options.gridId+"_fixedDiv").data("fixedGridLock","lock");var headTrNum=$("#"+options.gridId+" thead tr").length;if(!iFirst){headTrNum=headTrNum/2;$("#"+options.gridId+" thead tr:lt("+headTrNum+")").remove()}var fixedGridHeight=getSize(options.settings.extend.settings.fixedGridHeight);if(fixedGridHeight<$("#"+options.gridId).height()){$("#"+options.gridId+"_fixedDiv").height(fixedGridHeight);$("#"+options.gridId).width($("#"+options.gridId+"_fixedDiv").width()-18);$("#"+options.gridId+"_fixedDiv").animate({scrollTop:"0px"},0)}else{$("#"+options.gridId+"_fixedDiv").height($("#"+options.gridId).height());$("#"+options.gridId).width($("#"+options.gridId+"_fixedDiv").width()-1)}$("#"+options.gridId+" thead tr:lt("+headTrNum+")").clone(true).prependTo("#"+options.gridId+" thead");$("#"+options.gridId+" thead tr:lt("+headTrNum+")").css({"z-index":10,position:"fixed"}).width($("#"+options.gridId+" thead tr:last").width());$("#"+options.gridId+" thead tr:lt("+headTrNum+")").each(function(i){var position=$("#"+options.gridId+" thead tr:eq("+(headTrNum+i)+")").position();$(this).css({top:position.top-getSize($(this).find("th").css("border-top-width")),left:position.left})});$("#"+options.gridId+" thead tr:gt("+(headTrNum-1)+")").each(function(ri){$(this).find("th").each(function(i){var thObj=$(this);$("#"+options.gridId+" thead tr:eq("+ri+") th:eq("+i+")").height(thObj.height()+((ri==headTrNum-1)?2:1)*getSize(thObj.css("border-top-width"))).width(thObj.width()+getSize(thObj.css("border-left-width")))})});$("#"+options.gridId+"_fixedDiv").data("fixedGridLock","");function getSize(sizeStr){sizeStr=$.trim(sizeStr).toLowerCase().replace("px","");var sizeNum=parseFloat(sizeStr);return isNaN(sizeNum)?0:sizeNum}};$.fn.bsgrid.extendOtherMethods.initFixedHeader=function(gridId,options){$("#"+gridId).wrap('');$("#"+gridId+"_fixedDiv").data("fixedGridLock","");$("#"+gridId+"_fixedDiv").css({padding:0,"border-width":0,width:"98%","overflow-y":"auto","margin-bottom":"-1px"});$("#"+gridId).css({width:"auto"});$("#"+gridId+"_pt_outTab").css({"border-top-width":"1px"});$.fn.bsgrid.extendOtherMethods.fixedHeader(true,options);$(window).resize(function(){$.fn.bsgrid.extendOtherMethods.fixedHeader(false,options)})}})(jQuery);
(function(a){a.bsgrid_export={defaults:{url:"",exportFileName:"export",colsProperties:{width:100,align:"center",exportAttr:"w_export",indexAttr:"w_index",widthAttr:"width",alignAttr:"w_align"},colWidthPercentmultiplier:14,requestParamsName:{exportFileName:"exportFileName",colNames:"dataNames",colIndexs:"dataIndexs",colWidths:"dataLengths",colAligns:"dataAligns"}},doExport:function(h,o,d){if(o==undefined){o={}}var c={};if(d==undefined){d={}}a.extend(true,c,a.bsgrid_export.defaults,d);var n="",g="",m="",j="";for(var f=0;f');var d=a(this).get(0).attributes;for(var e=0;e')})},showForm:function(b,c){b.formType=c;this.showOrHideRequireSpan(b,c);this.showOrHideAssistForms(b,c);this.showOrHideTag(b,c);if(c.startWith("view")){a(".formInput :input:not(:button,:submit,:reset)",b.jqueryObj).css({"border-width":"0"}).attr("readOnly","readOnly")}else{if(c.startWith("add")){a(".formInput :input:not(:button,:submit,:reset)",b.jqueryObj).css({border:"solid 1px #abadb3"}).removeAttr("readOnly")}else{if(c.startWith("edit")){a(".formInput :input:not(:button,:submit,:reset)",b.jqueryObj).css({border:"solid 1px #abadb3"}).removeAttr("readOnly");a(".formInput :input["+c+"Able=false]",b.jqueryObj).css({"border-width":"0"}).attr("readOnly","readOnly")}}}},showOrHideRequireSpan:function(b,c){if(c.startWith("view")){a(".formLabel span.require",b.jqueryObj).hide()}else{if(c.startWith("edit")){a(".formLabel:has(span.require) ~ .formInput:has(:input["+c+"Able=false])",b.jqueryObj).prev().find("span.require").hide()}else{a(".formLabel span.require",b.jqueryObj).show()}}},showOrHideAssistForms:function(b,c){a(".formInput select",b.jqueryObj).each(function(){var e=(c.startWith("view")||(c.startWith("edit")&&a(this).attr(c+"Able")=="false"))?"block":"none";a(this).prev("input").css("display",e).val(a(this).find("option:selected").text());var d=e=="block"?"none":"block";a(this).css("display",d)});a(".formInput textarea",b.jqueryObj).each(function(){var e=(c.startWith("view")||(c.startWith("edit")&&a(this).attr(c+"Able")=="false"))?"block":"none";a(this).prev("div").css("display",e).html(a(this).val());var d=e=="block"?"none":"block";a(this).css("display",d)})},showOrHideTag:function(b,c){a("*",b.jqueryObj).each(function(){var d=a.trim(a(this).attr("showType"));if(d!=""){if((c.startWith("view")||c.startWith("add")||c.startWith("edit"))&&(","+d+",").indexOf(","+c+",")>-1){a(this).show()}else{a(this).hide()}}})}}})(jQuery);
diff --git a/builds/merged/form.all.min.js b/builds/merged/form.all.min.js
index 2850252..e0d14f6 100644
--- a/builds/merged/form.all.min.js
+++ b/builds/merged/form.all.min.js
@@ -1,5 +1,5 @@
/**
-* jQuery.bsgrid v1.36 by @Baishui2004
+* jQuery.bsgrid v1.37 by @Baishui2004
* Copyright 2014 Apache v2 License
* https://github.com/baishui2004/jquery.bsgrid
*/
diff --git a/builds/merged/grid.all.min.css b/builds/merged/grid.all.min.css
index 78f3e0f..d6ae703 100644
--- a/builds/merged/grid.all.min.css
+++ b/builds/merged/grid.all.min.css
@@ -1,4 +1,4 @@
@CHARSET "UTF-8";.bsgrid{font-size:13px;font-family:'微软雅黑',Verdana,sans-serif,'宋体',serif}table.bsgrid{width:98%;margin-right:5px;border-collapse:collapse}.bsgrid th,.bsgrid td{padding:3px;border:solid 1px #ccc;background-color:white;text-align:center;color:#333;line-height:1.8em}.bsgrid td.lineWrap{word-break:break-all}.bsgrid td.lineNoWrap{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bsgrid th{font-weight:400;background:url(../images/skins/default/bg.gif) repeat-x #f4f4f4}.bsgrid tr.even_index_row td{background-color:#eef}.bsgrid tr.row_hover td{background-color:#fff1cc!important}.bsgrid tr.selected.selected_color td{background-color:#fff1cc!important}.bsgrid a{color:#f60;text-decoration:none}.bsgrid th .sort.sort-view{background:url(../images/sort-view.gif) no-repeat center;margin-left:3px}.bsgrid th .sort.sort-asc{background:url(../images/sort-asc.gif) no-repeat top;margin-left:3px}.bsgrid th .sort.sort-desc{background:url(../images/sort-desc.gif) no-repeat bottom;margin-left:3px}.bsgrid.lockscreen{position:fixed;z-index:2014;display:none;left:0;top:0;width:100%;height:100%;background:#000;filter:alpha(opacity=10);opacity:.1;-moz-opacity:.1}.bsgrid.loading_div{position:fixed;z-index:2015;display:none;left:0;top:0;width:100%;height:100%}.bsgrid.loading_div table{width:100%;height:100%}.bsgrid.loading_div td{width:100%;height:100%;background-color:transparent!important;text-align:center;vertical-align:middle}.bsgrid.loading_div td div{width:200px;padding-top:8px;padding-bottom:8px;color:#000;border:solid 1px #999;background-color:#fff}.bsgrid.loading{padding-left:5px;line-height:1.5em}.bsgrid.loading span{background:url("../images/loading.gif") no-repeat center}.bsgridPagingOutTab{width:98%;margin-right:5px;border-collapse:collapse;border:solid 1px #ccc;background-color:white;border-top-width:0}
-@CHARSET "UTF-8";.bsgridPaging{font-size:13px;font-family:'微软雅黑',Verdana,sans-serif,'宋体',serif;width:770px;border-collapse:collapse}.bsgridPaging.pagingLittleToolbar{width:550px}.bsgridPaging.noPageSizeSelect{width:650px}.bsgridPaging.pagingLittleToolbar.pagingLittleToolbar{width:430px}.bsgridPaging td{text-align:center}.bsgridPaging select{font-size:inherit;width:auto;height:auto;padding:1px;margin:1px}.bsgridPaging .pagingBtn{cursor:pointer;border:solid 1px #ccc;background:url(../images/skins/default/bg.gif) repeat-x #f4f4f4;font-size:inherit;font-family:inherit;color:inherit;padding:1px 3px;margin:1px}.bsgridPaging.pagingLittleToolbar .pagingBtn{width:16px;border-width:0;background:transparent no-repeat;padding:0;margin:3px}.bsgridPaging .pagingBtn.disabledCls{color:#999;filter:alpha(opacity=50);opacity:.5;-moz-opacity:.5}.bsgridPaging.pagingLittleToolbar .pagingBtn.firstPage{background-image:url(../images/icons/paging/go-first-view.png)}.bsgridPaging.pagingLittleToolbar .pagingBtn.prevPage{background-image:url(../images/icons/paging/go-previous-view.png)}.bsgridPaging.pagingLittleToolbar .pagingBtn.nextPage{background-image:url(../images/icons/paging/go-next-view.png)}.bsgridPaging.pagingLittleToolbar .pagingBtn.lastPage{background-image:url(../images/icons/paging/go-last-view.png)}.bsgridPaging .gotoPageInputTd{width:44px}.bsgridPaging .gotoPageInput{width:40px;height:auto;font-size:inherit;line-height:1em;color:inherit;border:solid 1px #ccc;padding:1px;margin:1px}.bsgridPaging .gotoPageButtonTd{text-align:left}.bsgridPaging .refreshPageTd{text-align:right;padding-right:4px}.bsgridPaging.pagingLittleToolbar .pagingBtn.gotoPage{background-image:url(../images/icons/paging/go-jump-2.png)}.bsgridPaging.pagingLittleToolbar .pagingBtn.refreshPage{background-image:url(../images/icons/paging/view-refresh-3.png)}
+@CHARSET "UTF-8";.bsgridPaging{font-size:13px;font-family:'微软雅黑',Verdana,sans-serif,'宋体',serif;width:770px;border-collapse:collapse}.bsgridPaging.pagingLittleToolbar{width:550px}.bsgridPaging.noPageSizeSelect{width:650px}.bsgridPaging.pagingLittleToolbar.noPageSizeSelect{width:430px}.bsgridPaging td{text-align:center}.bsgridPaging select{font-size:inherit;width:auto;height:auto;padding:1px;margin:1px}.bsgridPaging .pagingBtn{cursor:pointer;border:solid 1px #ccc;background:url(../images/skins/default/bg.gif) repeat-x #f4f4f4;font-size:inherit;font-family:inherit;color:inherit;padding:1px 3px;margin:1px}.bsgridPaging.pagingLittleToolbar .pagingBtn{width:16px;border-width:0;background:transparent no-repeat;padding:0;margin:3px}.bsgridPaging .pagingBtn.disabledCls{color:#999;filter:alpha(opacity=50);opacity:.5;-moz-opacity:.5}.bsgridPaging.pagingLittleToolbar .pagingBtn.firstPage{background-image:url(../images/icons/paging/go-first-view.png)}.bsgridPaging.pagingLittleToolbar .pagingBtn.prevPage{background-image:url(../images/icons/paging/go-previous-view.png)}.bsgridPaging.pagingLittleToolbar .pagingBtn.nextPage{background-image:url(../images/icons/paging/go-next-view.png)}.bsgridPaging.pagingLittleToolbar .pagingBtn.lastPage{background-image:url(../images/icons/paging/go-last-view.png)}.bsgridPaging .gotoPageInputTd{width:44px}.bsgridPaging .gotoPageInput{width:40px;height:auto;font-size:inherit;line-height:1em;color:inherit;border:solid 1px #ccc;padding:1px;margin:1px}.bsgridPaging .gotoPageButtonTd{text-align:left}.bsgridPaging .refreshPageTd{text-align:right;padding-right:4px}.bsgridPaging.pagingLittleToolbar .pagingBtn.gotoPage{background-image:url(../images/icons/paging/go-jump-2.png)}.bsgridPaging.pagingLittleToolbar .pagingBtn.refreshPage{background-image:url(../images/icons/paging/view-refresh-3.png)}
@CHARSET "UTF-8";.bsgrid th .bsgrid_editgrid_check,.bsgrid td .bsgrid_editgrid_check{text-align:inherit}.bsgrid th .bsgrid_editgrid_checkbox,.bsgrid td .bsgrid_editgrid_checkbox{text-align:inherit}.bsgrid td .bsgrid_editgrid_edit{width:95%;text-align:inherit}.bsgrid td .bsgrid_editgrid_change{border-color:hotpink}.bsgrid td .bsgrid_editgrid_hidden{display:none}
@CHARSET "UTF-8";.bsgrid_icon{cursor:pointer;font-family:'微软雅黑',Verdana,sans-serif,'宋体',serif;font-size:12px;line-height:1.5em;color:#b22222;background:no-repeat 3px center}a.bsgrid_icon{padding-left:20px;text-decoration:underline}input.bsgrid_icon,button.bsgrid_icon{padding-left:20px;padding-right:4px;background-color:#d5e2f2;border:solid 1px #99bbe8;width:auto;overflow:visible}.icon_view{background-image:url(../images/icons/view-list-details-5.png)}.icon_add{background-image:url(../images/icons/list-add-6.png)}.icon_edit{background-image:url(../images/icons/page-edit.png)}.icon_save{background-image:url(../images/icons/document-save-6.png)}.icon_delete{background-image:url(../images/icons/edit-delete-6.png)}.icon_delete2{background-image:url(../images/icons/edit-delete-7.png)}.icon_close{background-image:url(../images/icons/window-close-4.png)}.icon_close2{background-image:url(../images/icons/window-close.png)}.icon_find{background-image:url(../images/icons/edit-find-8.png)}.icon_search{background-image:url(../images/icons/system-search-6.png)}.icon_refresh{background-image:url(../images/icons/arrow-refresh.png)}.icon_sort-view{background-image:url(../images/icons/sort-view.gif)}.icon_sort-asc{background-image:url(../images/icons/view-sort-descending-2.png)}.icon_sort-desc{background-image:url(../images/icons/view-sort-ascending-2.png)}.icon_copy{background-image:url(../images/icons/edit-copy-7.png)}.icon_cut{background-image:url(../images/icons/edit-cut-7.png)}.icon_paste{background-image:url(../images/icons/edit-paste-7.png)}.icon_download{background-image:url(../images/icons/download.png)}.icon_print{background-image:url(../images/icons/document-print-2.png)}.icon_mail{background-image:url(../images/icons/mail-generic.png)}.icon_accept{background-image:url(../images/icons/dialog-accept-2.png)}.icon_flag{background-image:url(../images/icons/flag.png)}.icon_about{background-image:url(../images/icons/help-about-3.png)}.icon_help{background-image:url(../images/icons/help.png)}.icon_documentation{background-image:url(../images/icons/documentation.png)}.icon_config{background-image:url(../images/icons/configure-2.png)}.icon_config2{background-image:url(../images/icons/system-config-boot.png)}.icon_text{background-image:url(../images/icons/mimetypes/silk_style/page-white_text.png)}.icon_pdf{background-image:url(../images/icons/mimetypes/silk_style/page-white_acrobat.png)}.icon_excel{background-image:url(../images/icons/mimetypes/silk_style/page-white_excel.png)}.icon_word{background-image:url(../images/icons/mimetypes/silk_style/page-white_word.png)}
diff --git a/builds/merged/grid.all.min.js b/builds/merged/grid.all.min.js
index 070ff8e..5524e2d 100644
--- a/builds/merged/grid.all.min.js
+++ b/builds/merged/grid.all.min.js
@@ -1,12 +1,12 @@
/**
-* jQuery.bsgrid v1.36 by @Baishui2004
+* jQuery.bsgrid v1.37 by @Baishui2004
* Copyright 2014 Apache v2 License
* https://github.com/baishui2004/jquery.bsgrid
*/
String.prototype.startWith=function(a){if(a==null||a==""||this.length==0||a.length>this.length){return false}else{return this.substr(0,a.length)==a}};String.prototype.endWith=function(a){if(a==null||a==""||this.length==0||a.length>this.length){return false}else{return this.substring(this.length-a.length)==a}};String.prototype.replaceAll=function(a,b){return this.replace(new RegExp(a,"gm"),b)};function StringBuilder(){if(arguments.length){this.append.apply(this,arguments)}}StringBuilder.prototype=function(){var c=Array.prototype.join,d=Array.prototype.slice,a=/\{(\d+)\}/g,b=function(){return c.call(this,"")};return{constructor:StringBuilder,length:0,append:Array.prototype.push,appendFormat:function(e){var g=0,f=d.call(arguments,1);this.append(a.test(e)?e.replace(a,function(h,j){return f[j]}):e.replace(/\?/g,function(){return f[g++]}));return this},size:function(){return this.toString().length},toString:b,valueOf:b}}();
$.bsgrid={param:function(c,b){if(b==undefined){b=false}if(!b){return $.param(c)}var d=new StringBuilder();if(c instanceof Array){$.each(c,function(f,e){d.append("&"+e.name+"=");d.append(encodeURIComponent(encodeURIComponent(e.value)))})}else{for(var a in c){d.append("&"+a+"=");d.append(encodeURIComponent(encodeURIComponent(c[a])))}}return d.length>0?d.toString().substring(1):""},getKeysString:function(c,a){if(a==undefined){a=","}var d=new StringBuilder();if(c instanceof Array){$.each(c,function(f,e){if((d.toString()+a).indexOf(a+e.name+a)==-1){d.append(a+e.name)}})}else{for(var b in c){d.append(a+b)}}return d.length>0?d.toString().substring(1):""},forcePushPropertyInObject:function(b,a,c){if(b.hasOwnProperty(a)){b[a+"_f"]=c}else{b[a]=c}},adaptAttrOrProp:function(b,d,c){var a=parseInt($.fn.jquery.substring(0,$.fn.jquery.indexOf(".",2)).replace(".",""));if(c==undefined){if(a>=16){return b.prop(d)}else{return b.attr(d)}}else{if(a>=16){b.prop(d,c)}else{b.attr(d,c)}}},alert:function(a){alert(a)}};
-(function(a){a.fn.bsgrid_paging={defaults:{loopback:false,pageSize:20,pageSizeSelect:false,pageSizeForGrid:[5,10,20,25,50,100,200,500],pageIncorrectTurnAlert:true,pagingLittleToolbar:false,pagingBtnClass:"pagingBtn"},pagingObjs:{},init:function(h,g){var d={settings:a.extend(true,{},a.fn.bsgrid_paging.defaults,g),pagingId:h,totalRowsId:h+"_totalRows",totalPagesId:h+"_totalPages",curPageId:h+"_curPage",gotoPageInputId:h+"_gotoPageInput",gotoPageId:h+"_gotoPage",refreshPageId:h+"_refreshPage",pageSizeId:h+"_pageSize",firstPageId:h+"_firstPage",prevPageId:h+"_prevPage",nextPageId:h+"_nextPage",lastPageId:h+"_lastPage",startRowId:h+"_startRow",endRowId:h+"_endRow",totalRows:0,totalPages:0,curPage:1,curPageRowsNum:0,startRow:0,endRow:0};if(g.pageSizeForGrid!=undefined){d.settings.pageSizeForGrid=g.pageSizeForGrid}var b={options:d,page:function(i){a.fn.bsgrid_paging.page(i,d)},getCurPage:function(){return a.fn.bsgrid_paging.getCurPage(d)},refreshPage:function(){a.fn.bsgrid_paging.refreshPage(d)},firstPage:function(){a.fn.bsgrid_paging.firstPage(d)},prevPage:function(){a.fn.bsgrid_paging.prevPage(d)},nextPage:function(){a.fn.bsgrid_paging.nextPage(d)},lastPage:function(){a.fn.bsgrid_paging.lastPage(d)},gotoPage:function(i){a.fn.bsgrid_paging.gotoPage(d,i)},createPagingToolbar:function(){return a.fn.bsgrid_paging.createPagingToolbar(d)},setPagingToolbarEvents:function(){a.fn.bsgrid_paging.setPagingToolbarEvents(d)},dynamicChangePagingButtonStyle:function(){a.fn.bsgrid_paging.dynamicChangePagingButtonStyle(d)},setPagingValues:function(j,i){a.fn.bsgrid_paging.setPagingValues(j,i,d)}};a.fn.bsgrid_paging.pagingObjs[h]=b;a("#"+h).append(b.createPagingToolbar());if(d.settings.pageSizeSelect){if(a.inArray(d.settings.pageSize,d.settings.pageSizeForGrid)==-1){d.settings.pageSizeForGrid.push(d.settings.pageSize)}d.settings.pageSizeForGrid.sort(function(j,i){return j-i});var f=new StringBuilder();for(var e=0;e'+c+"")}a("#"+d.pageSizeId).html(f.toString()).val(d.settings.pageSize)}b.setPagingToolbarEvents();return b},getPagingObj:function(c){var b=a.fn.bsgrid_paging.pagingObjs[c];return b?b:null},page:function(c,b){var d=a.fn.bsgrid.getGridObj(b.settings.gridId);d.options.settings.pageSize=b.settings.pageSize;a.fn.bsgrid.page(c,d.options)},getCurPage:function(b){var c=a("#"+b.curPageId).html();return c==""?1:c},refreshPage:function(b){a.fn.bsgrid_paging.page(a.fn.bsgrid_paging.getCurPage(b),b)},firstPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c<=1){a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isFirstPage);return}a.fn.bsgrid_paging.page(1,b)},prevPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c<=1){if(b.settings.loopback&&b.totalPages>0){a.fn.bsgrid_paging.page(b.totalPages,b);return}else{a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isFirstPage);return}}a.fn.bsgrid_paging.page(parseInt(c)-1,b)},nextPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c>=b.totalPages){if(b.settings.loopback&&c>0){a.fn.bsgrid_paging.page(1,b);return}else{a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isLastPage);return}}a.fn.bsgrid_paging.page(parseInt(c)+1,b)},lastPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c>=b.totalPages){a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isLastPage);return}a.fn.bsgrid_paging.page(b.totalPages,b)},gotoPage:function(b,c){if(c==undefined){c=a("#"+b.gotoPageInputId).val()}if(a.trim(c)==""||isNaN(c)){a.fn.bsgrid_paging.alert(a.bsgridLanguage.needInteger)}else{if(parseInt(c)<1||parseInt(c)>b.totalPages){a.fn.bsgrid_paging.alert(a.bsgridLanguage.needRange(1,b.totalPages))}else{a("#"+b.gotoPageInputId).val(c);a.fn.bsgrid_paging.page(parseInt(c),b)}}},incorrectTurnAlert:function(b,c){if(b.settings.pageIncorrectTurnAlert){a.fn.bsgrid_paging.alert(c)}},alert:function(c){try{a.bsgrid.alert(c)}catch(b){alert(c)}},createPagingToolbar:function(b){var e=new StringBuilder();var c=b.settings.pagingLittleToolbar;e.append('");return e.toString()},setPagingToolbarEvents:function(b){if(b.settings.pageSizeSelect){a("#"+b.pageSizeId).change(function(){b.settings.pageSize=parseInt(a(this).val());a(this).trigger("blur");a.fn.bsgrid_paging.page(1,b)})}a("#"+b.firstPageId).click(function(){a.fn.bsgrid_paging.firstPage(b)});a("#"+b.prevPageId).click(function(){a.fn.bsgrid_paging.prevPage(b)});a("#"+b.nextPageId).click(function(){a.fn.bsgrid_paging.nextPage(b)});a("#"+b.lastPageId).click(function(){a.fn.bsgrid_paging.lastPage(b)});a("#"+b.gotoPageInputId).keyup(function(c){if(c.which==13){a.fn.bsgrid_paging.gotoPage(b)}});a("#"+b.gotoPageId).click(function(){a.fn.bsgrid_paging.gotoPage(b)});a("#"+b.refreshPageId).click(function(){a.fn.bsgrid_paging.refreshPage(b)})},dynamicChangePagingButtonStyle:function(b){var c="disabledCls";if(b.curPage<=1){a("#"+b.firstPageId).addClass(c);a("#"+b.prevPageId).addClass(c)}else{a("#"+b.firstPageId).removeClass(c);a("#"+b.prevPageId).removeClass(c)}if(b.curPage>=b.totalPages){a("#"+b.nextPageId).addClass(c);a("#"+b.lastPageId).addClass(c)}else{a("#"+b.nextPageId).removeClass(c);a("#"+b.lastPageId).removeClass(c)}},setPagingValues:function(i,g,f){i=Math.max(i,1);var b=f.settings.pageSize;var h=parseInt(g/b);h=parseInt((g%b==0)?h:h+1);var e=(i*b");$("#"+gridId).find("tr:lt("+($("#"+gridId+" tr").length-$("#"+gridId+" tfoot tr").length)+")").appendTo($("#"+gridId+" thead"))}if($("#"+gridId).find("tbody").length==0){$("#"+gridId+" thead").after("")}if($("#"+gridId).find("tfoot").length==0){$("#"+gridId).append('')}options.columnsModel=$.fn.bsgrid.initColumnsModel(options);if(settings.pageSizeForGrid!=undefined){options.settings.pageSizeForGrid=settings.pageSizeForGrid}options.settings.dataType=options.settings.dataType.toLowerCase();if(options.settings.pageSizeSelect){if($.inArray(options.settings.pageSize,options.settings.pageSizeForGrid)==-1){options.settings.pageSizeForGrid.push(options.settings.pageSize)}options.settings.pageSizeForGrid.sort(function(a,b){return a-b})}var gridObj={options:options,getPageCondition:function(curPage){return $.fn.bsgrid.getPageCondition(curPage,options)},page:function(curPage){$.fn.bsgrid.page(curPage,options)},search:function(params){$.fn.bsgrid.search(params,options)},loadGridData:function(dataType,gridData){$.fn.bsgrid.loadGridData(dataType,gridData,options)},getPageSize:function(){return options.settings.pageSize},getTotalRows:function(){return options.totalRows},getTotalPages:function(){return options.totalPages},getCurPage:function(){return options.curPage},getCurPageRowsNum:function(){return options.curPageRowsNum},getStartRow:function(){return options.startRow},getEndRow:function(){return options.endRow},getSortName:function(){return options.sortName},getSortOrder:function(){return options.sortOrder},getRows:function(){return $.fn.bsgrid.getRows(options)},getRow:function(row){return $.fn.bsgrid.getRow(row,options)},getRowCells:function(row){return $.fn.bsgrid.getRowCells(row,options)},getColCells:function(col){return $.fn.bsgrid.getColCells(col,options)},getCell:function(row,col){return $.fn.bsgrid.getCell(row,col,options)},getSelectedRow:function(){return $.fn.bsgrid.getSelectedRow(options)},getSelectedRowIndex:function(){return $.fn.bsgrid.getSelectedRowIndex(options)},selectRow:function(row){return $.fn.bsgrid.selectRow(row,options)},unSelectRow:function(){return $.fn.bsgrid.unSelectRow(options)},getUserdata:function(){return $.fn.bsgrid.getUserdata(options)},getRowRecord:function(rowObj){return $.fn.bsgrid.getRowRecord(rowObj)},getAllRecords:function(){return $.fn.bsgrid.getAllRecords(options)},getRecord:function(row){return $.fn.bsgrid.getRecord(row,options)},getRecordIndexValue:function(record,index){return $.fn.bsgrid.getRecordIndexValue(record,index,options)},getColumnValue:function(row,index){return $.fn.bsgrid.getColumnValue(row,index,options)},getCellRecordValue:function(row,col){return $.fn.bsgrid.getCellRecordValue(row,col,options)},sort:function(obj){$.fn.bsgrid.sort(obj,options)},getGridHeaderObject:function(){return $.fn.bsgrid.getGridHeaderObject(options)},getColumnModel:function(colIndex){return $.fn.bsgrid.getColumnModel(colIndex,options)},appendHeaderSort:function(){$.fn.bsgrid.appendHeaderSort(options)},setGridBlankBody:function(){$.fn.bsgrid.setGridBlankBody(options)},createPagingOutTab:function(){$.fn.bsgrid.createPagingOutTab(options)},clearGridBodyData:function(){$.fn.bsgrid.clearGridBodyData(options)},getPagingObj:function(){return $.fn.bsgrid.getPagingObj(options)},getCurPage:function(){return $.fn.bsgrid.getCurPage(options)},refreshPage:function(){$.fn.bsgrid.refreshPage(options)},firstPage:function(){$.fn.bsgrid.firstPage(options)},prevPage:function(){$.fn.bsgrid.prevPage(options)},nextPage:function(){$.fn.bsgrid.nextPage(options)},lastPage:function(){$.fn.bsgrid.lastPage(options)},gotoPage:function(goPage){$.fn.bsgrid.gotoPage(options,goPage)},initPaging:function(){return $.fn.bsgrid.initPaging(options)},setPagingValues:function(){$.fn.bsgrid.setPagingValues(options)}};$.fn.bsgrid.gridObjs[gridId]=gridObj;if(options.settings.pageAll||options.settings.pageSize<1){options.settings.pageAll=true;options.settings.pageSize=0}gridObj.appendHeaderSort();gridObj.createPagingOutTab();if(!options.settings.showPageToolbar){$("#"+options.pagingId).hide();$("#"+options.pagingOutTabId).hide()}if(!options.settings.pageAll){gridObj.pagingObj=gridObj.initPaging();try{var minWidth=$.trim($("#"+options.pagingId).children().width());minWidth=minWidth==""?0:parseInt(minWidth);if(minWidth!=0){$("#"+gridId).css("min-width",minWidth+16);$("#"+options.pagingOutTabId).css("min-width",minWidth+16)}$("#"+options.pagingOutTabId).width($("#"+gridId).width());$(window).resize(function(){$("#"+options.pagingOutTabId).width($("#"+gridId).width())})}catch(e){}}if(options.settings.isProcessLockScreen){$.fn.bsgrid.addLockScreen(options)}try{$.fn.bsgrid.extendInitGrid.initGridExtendOptions(gridId,options)}catch(e){}for(var key in options.settings.extend.initGridMethods){options.settings.extend.initGridMethods[key](gridId,options)}if(options.settings.autoLoad){setTimeout(function(){gridObj.page(1)},10)}else{gridObj.setGridBlankBody()}return gridObj},initColumnsModel:function(options){var columnsModel=[];$.fn.bsgrid.getGridHeaderObject(options).each(function(){var colsProperties=options.settings.colsProperties;var columnModel={};columnModel.sortName="";columnModel.sortOrder="";var sortInfo=$.trim($(this).attr(colsProperties.sortAttr));if(sortInfo.length!=0){var sortInfoArray=sortInfo.split(",");columnModel.sortName=$.trim(sortInfoArray[0]);columnModel.sortOrder=$.trim(sortInfoArray.length>1?sortInfoArray[1]:"")}columnModel.index=$.trim($(this).attr(colsProperties.indexAttr));columnModel.render=$.trim($(this).attr(colsProperties.renderAttr));columnModel.tip=$.trim($(this).attr(colsProperties.tipAttr));var maxLen=$.trim($(this).attr(colsProperties.lengthAttr));columnModel.maxLen=maxLen.length!=0?parseInt(maxLen):colsProperties.maxLength;var align=$.trim($(this).attr(colsProperties.alignAttr));columnModel.align=align==""?colsProperties.align:align;columnModel.hidden=$.trim($(this).attr(colsProperties.hiddenAttr));columnsModel.push(columnModel)});return columnsModel},getGridObj:function(gridId){var obj=$.fn.bsgrid.gridObjs[gridId];return obj?obj:null},buildData:{gridData:function(type,curPage,data){if(type=="json"){return $.fn.bsgrid.buildJsonData.gridData(curPage,data)}else{if(type=="xml"){return $.fn.bsgrid.buildXmlData.gridData(curPage,data)}}return false}},parseData:{success:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.success(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.success(gridData)}}return false},totalRows:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.totalRows(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.totalRows(gridData)}}return false},curPage:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.curPage(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.curPage(gridData)}}return false},data:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.data(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.data(gridData)}}return false},userdata:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.userdata(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.userdata(gridData)}}return false},getDataLen:function(type,gridData){if(type=="json"||type=="xml"){return $.fn.bsgrid.parseData.data(type,gridData).length}return 0},getRecord:function(type,data,row){if(type=="json"){return $.fn.bsgrid.parseJsonData.getRecord(data,row)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.getRecord(data,row)}}return false},getColumnValue:function(type,record,index){if(type=="json"){return $.fn.bsgrid.parseJsonData.getColumnValue(record,index)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.getColumnValue(record,index)}}return false}},buildJsonData:{gridData:function(curPage,data){return{success:true,totalRows:data.length,curPage:curPage,data:data}}},parseJsonData:{success:function(json){return json.success},totalRows:function(json){return json.totalRows},curPage:function(json){return json.curPage},data:function(json){return json.data},userdata:function(json){return json.userdata},getRecord:function(data,row){return data[row]},getColumnValue:function(record,index){return $.trim(record[index])}},buildXmlData:{gridData:function(curPage,data){return'true'+$(""+data+"").find("row").length+""+curPage+""+data+""}},parseXmlData:{success:function(xml){return $.trim($(xml).find("gridData success").text())=="true"},totalRows:function(xml){return parseInt($(xml).find("gridData totalRows").text())},curPage:function(xml){return parseInt($(xml).find("gridData curPage").text())},data:function(xml){return $(xml).find("gridData data row")},userdata:function(xml){return $(xml).find("gridData userdata")},getRecord:function(data,row){return data.eq(row)},getColumnValue:function(record,index){return $.trim(record.find(index).text())}},getPageCondition:function(curPage,options){var params=new StringBuilder();if(options.otherParames==false){}else{if((typeof options.otherParames).toLowerCase()=="string"||options.otherParames instanceof String){params.append("&"+options.otherParames)}else{if(options.otherParames instanceof Array){$.each(options.otherParames,function(i,objVal){params.append("&"+objVal.name+"="+objVal.value)})}else{for(var key in options.otherParames){params.append("&"+key+"="+options.otherParames[key])}}}}var condition=params.length==0?"":params.toString().substring(1);condition+=(condition.length==0?"":"&")+options.settings.requestParamsName.pageSize+"="+options.settings.pageSize+"&"+options.settings.requestParamsName.curPage+"="+curPage+"&"+options.settings.requestParamsName.sortName+"="+options.sortName+"&"+options.settings.requestParamsName.sortOrder+"="+options.sortOrder;return condition},search:function(params,options){options.otherParames=params;$.fn.bsgrid.page(1,options)},page:function(curPage,options){if($.trim(curPage)==""||isNaN(curPage)){$.fn.bsgrid.alert($.bsgridLanguage.needInteger);return}var dataType=options.settings.dataType;if(options.settings.localData!=false){if(dataType=="json"){$.fn.bsgrid.loadGridData(dataType,$.fn.bsgrid.buildData.gridData(dataType,curPage,options.settings.localData),options)}else{if(dataType=="xml"){$.fn.bsgrid.loadGridData(dataType,""+$.fn.bsgrid.buildData.gridData(dataType,curPage,options.settings.localData)+"",options)}}return}$.ajax({type:options.settings.ajaxType,url:options.settings.url,data:$.fn.bsgrid.getPageCondition(curPage,options),dataType:dataType,beforeSend:function(XMLHttpRequest){if(options.settings.isProcessLockScreen){$.fn.bsgrid.lockScreen(options)}options.settings.beforeSend(options,XMLHttpRequest)},complete:function(XMLHttpRequest,textStatus){options.settings.complete(options,XMLHttpRequest,textStatus);if(options.settings.isProcessLockScreen){$.fn.bsgrid.unlockScreen(options)}},success:function(gridData,textStatus){$.fn.bsgrid.loadGridData(dataType,gridData,options)},error:function(XMLHttpRequest,textStatus,errorThrown){$.fn.bsgrid.alert($.bsgridLanguage.errorForSendOrRequestData)}})},loadGridData:function(dataType,gridData,options){var parseSuccess=$.fn.bsgrid.parseData.success(dataType,gridData);for(var key in options.settings.extend.beforeRenderGridMethods){options.settings.extend.beforeRenderGridMethods[key](parseSuccess,gridData,options)}options.settings.additionalBeforeRenderGrid(parseSuccess,gridData,options);if(parseSuccess){var userdata=$.fn.bsgrid.parseData.userdata(dataType,gridData);$.fn.bsgrid.storeUserdata(userdata,options);options.settings.processUserdata(userdata,options);var totalRows=parseInt($.fn.bsgrid.parseData.totalRows(dataType,gridData));var curPage=parseInt($.fn.bsgrid.parseData.curPage(dataType,gridData));curPage=Math.max(curPage,1);if(options.settings.pageAll){curPage=1;options.settings.pageSize=totalRows;$("#"+options.noPagingationId).html(totalRows)}var pageSize=options.settings.pageSize;var totalPages=parseInt(totalRows/pageSize);totalPages=parseInt((totalRows%pageSize==0)?totalPages:totalPages+1);var curPageRowsNum=$.fn.bsgrid.parseData.getDataLen(dataType,gridData);curPageRowsNum=curPageRowsNum>pageSize?pageSize:curPageRowsNum;curPageRowsNum=(curPage*pageSize ';$(this).append(sortHtml).find(".sort").click(function(){$.fn.bsgrid.sort($(this).parent("th"),options)})}})},setGridBlankBody:function(options){$.fn.bsgrid.getRows(options).remove();var header=$.fn.bsgrid.getGridHeaderObject(options);var columnsModel=options.columnsModel;for(var hi=0;hi0){var trSb=new StringBuilder();trSb.append("");for(var hi=0;hi ")}trSb.append("
");rowSb=trSb.toString()}var rowsSb=new StringBuilder();var curPageRowsNum=options.settings.pageSize;if(!options.settings.displayBlankRows){curPageRowsNum=options.endRow-options.startRow+1;curPageRowsNum=options.endRow>0?curPageRowsNum:0}if(curPageRowsNum==0){rowsSb.append(''+$.bsgridLanguage.noDataToDisplay+" |
")}else{for(var pi=0;pi');if(options.settings.pageAll){pagingOutTabSb.append($.bsgridLanguage.noPagingation(options.noPagingationId)+" ")}pagingOutTabSb.append(" |
");$("#"+options.gridId).after(pagingOutTabSb.toString())},clearGridBodyData:function(options){$.fn.bsgrid.getRows(options).find("td").html(" ")},addLockScreen:function(options){if($(".bsgrid.lockscreen").length==0){var lockScreenHtml=new StringBuilder();lockScreenHtml.append('');lockScreenHtml.append("
");lockScreenHtml.append('');lockScreenHtml.append('
'+$.bsgridLanguage.loadingDataMessage+" |
");lockScreenHtml.append("
");$("body").append(lockScreenHtml.toString())}},lockScreen:function(options){$(".bsgrid.lockscreen").attr("times",parseInt($(".bsgrid.lockscreen").attr("times"))+1);if($(".bsgrid.lockscreen").css("display")=="none"){$(".bsgrid.lockscreen").show();$(".bsgrid.loading_div").show()}},unlockScreen:function(options){$(".bsgrid.lockscreen").attr("times",parseInt($(".bsgrid.lockscreen").attr("times"))-1);if($(".bsgrid.lockscreen").attr("times")=="0"){setTimeout(function(){$(".bsgrid.lockscreen").hide();$(".bsgrid.loading_div").hide()},50)}},columnTip:function(obj,value,record){$(obj).attr("title",value)},alert:function(msg){try{$.bsgrid.alert(msg)}catch(e){alert(msg)}},longLengthSubAndTip:function(obj,value,maxLen,record){var tip=false;if(value.length>maxLen){try{if(value.indexOf("<")<0||value.indexOf(">")<2||$(value).text().length==0){tip=true}}catch(e){tip=true}}if(tip){$(obj).html(value.substring(0,maxLen-3)+"...");$.fn.bsgrid.columnTip(obj,value,record)}else{$(obj).html(value)}},getPagingObj:function(options){return $.fn.bsgrid.getGridObj(options.gridId).pagingObj},getCurPage:function(options){return $.fn.bsgrid.getPagingObj(options).getCurPage()},refreshPage:function(options){if(!options.settings.pageAll){$.fn.bsgrid.getPagingObj(options).refreshPage()}else{$.fn.bsgrid.page(1,options)}},firstPage:function(options){$.fn.bsgrid.getPagingObj(options).firstPage()},prevPage:function(options){$.fn.bsgrid.getPagingObj(options).prevPage()},nextPage:function(options){$.fn.bsgrid.getPagingObj(options).nextPage()},lastPage:function(options){$.fn.bsgrid.getPagingObj(options).lastPage()},gotoPage:function(options,goPage){$.fn.bsgrid.getPagingObj(options).gotoPage(goPage)},initPaging:function(options){$("#"+options.pagingOutTabId+" td").attr("id",options.pagingId);return $.fn.bsgrid_paging.init(options.pagingId,{gridId:options.gridId,pageSize:options.settings.pageSize,pageSizeSelect:options.settings.pageSizeSelect,pageSizeForGrid:options.settings.pageSizeForGrid,pageIncorrectTurnAlert:options.settings.pageIncorrectTurnAlert,pagingLittleToolbar:options.settings.pagingLittleToolbar,pagingBtnClass:options.settings.pagingBtnClass})},setPagingValues:function(options){$.fn.bsgrid.getPagingObj(options).setPagingValues(options.curPage,options.totalRows)}}})(jQuery);
+(function(a){a.fn.bsgrid_paging={defaults:{loopback:false,pageSize:20,pageSizeSelect:false,pageSizeForGrid:[5,10,20,25,50,100,200,500],pageIncorrectTurnAlert:true,pagingLittleToolbar:false,pagingBtnClass:"pagingBtn",pagingMinWidth:"auto",pagingBtnShowState:{select:true,first:true,prev:true,next:true,last:true,gotoBtn:true,refresh:true}},pagingObjs:{},init:function(h,g){var d={settings:a.extend(true,{},a.fn.bsgrid_paging.defaults,g),pagingId:h,totalRowsId:h+"_totalRows",totalPagesId:h+"_totalPages",curPageId:h+"_curPage",gotoPageInputId:h+"_gotoPageInput",gotoPageId:h+"_gotoPage",refreshPageId:h+"_refreshPage",pageSizeId:h+"_pageSize",firstPageId:h+"_firstPage",prevPageId:h+"_prevPage",nextPageId:h+"_nextPage",lastPageId:h+"_lastPage",startRowId:h+"_startRow",endRowId:h+"_endRow",totalRows:0,totalPages:0,curPage:1,curPageRowsNum:0,startRow:0,endRow:0};if(g.pageSizeForGrid!=undefined){d.settings.pageSizeForGrid=g.pageSizeForGrid}var b={options:d,page:function(i){a.fn.bsgrid_paging.page(i,d)},getCurPage:function(){return a.fn.bsgrid_paging.getCurPage(d)},refreshPage:function(){a.fn.bsgrid_paging.refreshPage(d)},firstPage:function(){a.fn.bsgrid_paging.firstPage(d)},prevPage:function(){a.fn.bsgrid_paging.prevPage(d)},nextPage:function(){a.fn.bsgrid_paging.nextPage(d)},lastPage:function(){a.fn.bsgrid_paging.lastPage(d)},gotoPage:function(i){a.fn.bsgrid_paging.gotoPage(d,i)},createPagingToolbar:function(){return a.fn.bsgrid_paging.createPagingToolbar(d)},setPagingToolbarEvents:function(){a.fn.bsgrid_paging.setPagingToolbarEvents(d)},dynamicChangePagingButtonStyle:function(){a.fn.bsgrid_paging.dynamicChangePagingButtonStyle(d)},setPagingValues:function(j,i){a.fn.bsgrid_paging.setPagingValues(j,i,d)}};a.fn.bsgrid_paging.pagingObjs[h]=b;a("#"+h).append(b.createPagingToolbar());if(d.settings.pageSizeSelect){if(a.inArray(d.settings.pageSize,d.settings.pageSizeForGrid)==-1){d.settings.pageSizeForGrid.push(d.settings.pageSize)}d.settings.pageSizeForGrid.sort(function(j,i){return j-i});var f=new StringBuilder();for(var e=0;e'+c+"")}a("#"+d.pageSizeId).html(f.toString()).val(d.settings.pageSize)}b.setPagingToolbarEvents();return b},getPagingObj:function(c){var b=a.fn.bsgrid_paging.pagingObjs[c];return b?b:null},page:function(c,b){var d=a.fn.bsgrid.getGridObj(b.settings.gridId);d.options.settings.pageSize=b.settings.pageSize;a.fn.bsgrid.page(c,d.options)},getCurPage:function(b){var c=a("#"+b.curPageId).html();return c==""?1:c},refreshPage:function(b){a.fn.bsgrid_paging.page(a.fn.bsgrid_paging.getCurPage(b),b)},firstPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c<=1){a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isFirstPage);return}a.fn.bsgrid_paging.page(1,b)},prevPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c<=1){if(b.settings.loopback&&b.totalPages>0){a.fn.bsgrid_paging.page(b.totalPages,b);return}else{a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isFirstPage);return}}a.fn.bsgrid_paging.page(parseInt(c)-1,b)},nextPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c>=b.totalPages){if(b.settings.loopback&&c>0){a.fn.bsgrid_paging.page(1,b);return}else{a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isLastPage);return}}a.fn.bsgrid_paging.page(parseInt(c)+1,b)},lastPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c>=b.totalPages){a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isLastPage);return}a.fn.bsgrid_paging.page(b.totalPages,b)},gotoPage:function(b,c){if(c==undefined){c=a("#"+b.gotoPageInputId).val()}if(a.trim(c)==""||isNaN(c)){a.fn.bsgrid_paging.alert(a.bsgridLanguage.needInteger)}else{if(parseInt(c)<1||parseInt(c)>b.totalPages){a.fn.bsgrid_paging.alert(a.bsgridLanguage.needRange(1,b.totalPages))}else{a("#"+b.gotoPageInputId).val(c);a.fn.bsgrid_paging.page(parseInt(c),b)}}},incorrectTurnAlert:function(b,c){if(b.settings.pageIncorrectTurnAlert){a.fn.bsgrid_paging.alert(c)}},alert:function(c){try{a.bsgrid.alert(c)}catch(b){alert(c)}},createPagingToolbar:function(b){var e=new StringBuilder();var c=b.settings.pagingLittleToolbar;e.append('");return e.toString()},setPagingToolbarEvents:function(b){if(b.settings.pageSizeSelect){a("#"+b.pageSizeId).change(function(){b.settings.pageSize=parseInt(a(this).val());a(this).trigger("blur");a.fn.bsgrid_paging.page(1,b)})}a("#"+b.firstPageId).click(function(){a.fn.bsgrid_paging.firstPage(b)});a("#"+b.prevPageId).click(function(){a.fn.bsgrid_paging.prevPage(b)});a("#"+b.nextPageId).click(function(){a.fn.bsgrid_paging.nextPage(b)});a("#"+b.lastPageId).click(function(){a.fn.bsgrid_paging.lastPage(b)});a("#"+b.gotoPageInputId).keyup(function(c){if(c.which==13){a.fn.bsgrid_paging.gotoPage(b)}});a("#"+b.gotoPageId).click(function(){a.fn.bsgrid_paging.gotoPage(b)});a("#"+b.refreshPageId).click(function(){a.fn.bsgrid_paging.refreshPage(b)})},dynamicChangePagingButtonStyle:function(b){var c="disabledCls";if(b.curPage<=1){a("#"+b.firstPageId).addClass(c);a("#"+b.prevPageId).addClass(c)}else{a("#"+b.firstPageId).removeClass(c);a("#"+b.prevPageId).removeClass(c)}if(b.curPage>=b.totalPages){a("#"+b.nextPageId).addClass(c);a("#"+b.lastPageId).addClass(c)}else{a("#"+b.nextPageId).removeClass(c);a("#"+b.lastPageId).removeClass(c)}},setPagingValues:function(i,g,f){i=Math.max(i,1);var b=f.settings.pageSize;var h=parseInt(g/b);h=parseInt((g%b==0)?h:h+1);var e=(i*b");$("#"+gridId).find("tr:lt("+($("#"+gridId+" tr").length-$("#"+gridId+" tfoot tr").length)+")").appendTo($("#"+gridId+" thead"))}if($("#"+gridId).find("tbody").length==0){$("#"+gridId+" thead").after("")}if($("#"+gridId).find("tfoot").length==0){$("#"+gridId).append('')}options.columnsModel=$.fn.bsgrid.initColumnsModel(options);if(settings.pageSizeForGrid!=undefined){options.settings.pageSizeForGrid=settings.pageSizeForGrid}options.settings.dataType=options.settings.dataType.toLowerCase();if(options.settings.pageSizeSelect){if($.inArray(options.settings.pageSize,options.settings.pageSizeForGrid)==-1){options.settings.pageSizeForGrid.push(options.settings.pageSize)}options.settings.pageSizeForGrid.sort(function(a,b){return a-b})}var gridObj={options:options,getPageCondition:function(curPage){return $.fn.bsgrid.getPageCondition(curPage,options)},page:function(curPage){$.fn.bsgrid.page(curPage,options)},search:function(params){$.fn.bsgrid.search(params,options)},loadGridData:function(dataType,gridData){$.fn.bsgrid.loadGridData(dataType,gridData,options)},reloadLocalData:function(localData){$.fn.bsgrid.reloadLocalData(localData,options)},getPageSize:function(){return options.settings.pageSize},getTotalRows:function(){return options.totalRows},getTotalPages:function(){return options.totalPages},getCurPage:function(){return options.curPage},getCurPageRowsNum:function(){return options.curPageRowsNum},getStartRow:function(){return options.startRow},getEndRow:function(){return options.endRow},getSortName:function(){return options.sortName},getSortOrder:function(){return options.sortOrder},getRows:function(){return $.fn.bsgrid.getRows(options)},getRow:function(row){return $.fn.bsgrid.getRow(row,options)},getRowCells:function(row){return $.fn.bsgrid.getRowCells(row,options)},getColCells:function(col){return $.fn.bsgrid.getColCells(col,options)},getCell:function(row,col){return $.fn.bsgrid.getCell(row,col,options)},getSelectedRow:function(){return $.fn.bsgrid.getSelectedRow(options)},getSelectedRowIndex:function(){return $.fn.bsgrid.getSelectedRowIndex(options)},selectRow:function(row){return $.fn.bsgrid.selectRow(row,options)},unSelectRow:function(){return $.fn.bsgrid.unSelectRow(options)},getUserdata:function(){return $.fn.bsgrid.getUserdata(options)},getRowRecord:function(rowObj){return $.fn.bsgrid.getRowRecord(rowObj)},getAllRecords:function(){return $.fn.bsgrid.getAllRecords(options)},getRecord:function(row){return $.fn.bsgrid.getRecord(row,options)},getRecordIndexValue:function(record,index){return $.fn.bsgrid.getRecordIndexValue(record,index,options)},getColumnValue:function(row,index){return $.fn.bsgrid.getColumnValue(row,index,options)},getCellRecordValue:function(row,col){return $.fn.bsgrid.getCellRecordValue(row,col,options)},sort:function(obj){$.fn.bsgrid.sort(obj,options)},getGridHeaderObject:function(){return $.fn.bsgrid.getGridHeaderObject(options)},getColumnModel:function(colIndex){return $.fn.bsgrid.getColumnModel(colIndex,options)},appendHeaderSort:function(){$.fn.bsgrid.appendHeaderSort(options)},setGridBlankBody:function(){$.fn.bsgrid.setGridBlankBody(options)},createPagingOutTab:function(){$.fn.bsgrid.createPagingOutTab(options)},clearGridBodyData:function(){$.fn.bsgrid.clearGridBodyData(options)},getPagingObj:function(){return $.fn.bsgrid.getPagingObj(options)},getCurPage:function(){return $.fn.bsgrid.getCurPage(options)},refreshPage:function(){$.fn.bsgrid.refreshPage(options)},firstPage:function(){$.fn.bsgrid.firstPage(options)},prevPage:function(){$.fn.bsgrid.prevPage(options)},nextPage:function(){$.fn.bsgrid.nextPage(options)},lastPage:function(){$.fn.bsgrid.lastPage(options)},gotoPage:function(goPage){$.fn.bsgrid.gotoPage(options,goPage)},initPaging:function(){return $.fn.bsgrid.initPaging(options)},setPagingValues:function(){$.fn.bsgrid.setPagingValues(options)}};$.fn.bsgrid.gridObjs[gridId]=gridObj;if(options.settings.pageAll||options.settings.pageSize<1){options.settings.pageAll=true;options.settings.pageSize=0}gridObj.appendHeaderSort();gridObj.createPagingOutTab();if(!options.settings.showPageToolbar){$("#"+options.pagingId).hide();$("#"+options.pagingOutTabId).hide()}if(!options.settings.pageAll){gridObj.pagingObj=gridObj.initPaging();try{var minWidth=$.trim($("#"+options.pagingId).children().width());minWidth=minWidth==""?0:parseInt(minWidth);if(minWidth!=0){$("#"+gridId).css("min-width",minWidth+16);$("#"+options.pagingOutTabId).css("min-width",minWidth+16)}$("#"+options.pagingOutTabId).width($("#"+gridId).width());$(window).resize(function(){$("#"+options.pagingOutTabId).width($("#"+gridId).width())})}catch(e){}}if(options.settings.isProcessLockScreen){$.fn.bsgrid.addLockScreen(options)}try{$.fn.bsgrid.extendInitGrid.initGridExtendOptions(gridId,options)}catch(e){}for(var key in options.settings.extend.initGridMethods){options.settings.extend.initGridMethods[key](gridId,options)}if(options.settings.autoLoad){setTimeout(function(){gridObj.page(1)},10)}else{gridObj.setGridBlankBody()}return gridObj},initColumnsModel:function(options){var columnsModel=[];$.fn.bsgrid.getGridHeaderObject(options).each(function(){var colsProperties=options.settings.colsProperties;var columnModel={};columnModel.sortName="";columnModel.sortOrder="";var sortInfo=$.trim($(this).attr(colsProperties.sortAttr));if(sortInfo.length!=0){var sortInfoArray=sortInfo.split(",");columnModel.sortName=$.trim(sortInfoArray[0]);columnModel.sortOrder=$.trim(sortInfoArray.length>1?sortInfoArray[1]:"")}columnModel.index=$.trim($(this).attr(colsProperties.indexAttr));columnModel.render=$.trim($(this).attr(colsProperties.renderAttr));columnModel.tip=$.trim($(this).attr(colsProperties.tipAttr));var maxLen=$.trim($(this).attr(colsProperties.lengthAttr));columnModel.maxLen=maxLen.length!=0?parseInt(maxLen):colsProperties.maxLength;var align=$.trim($(this).attr(colsProperties.alignAttr));columnModel.align=align==""?colsProperties.align:align;columnModel.hidden=$.trim($(this).attr(colsProperties.hiddenAttr));columnsModel.push(columnModel)});return columnsModel},getGridObj:function(gridId){var obj=$.fn.bsgrid.gridObjs[gridId];return obj?obj:null},buildData:{gridData:function(type,curPage,data){if(type=="json"){return $.fn.bsgrid.buildJsonData.gridData(curPage,data)}else{if(type=="xml"){return $.fn.bsgrid.buildXmlData.gridData(curPage,data)}}return false}},parseData:{success:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.success(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.success(gridData)}}return false},totalRows:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.totalRows(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.totalRows(gridData)}}return false},curPage:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.curPage(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.curPage(gridData)}}return false},data:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.data(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.data(gridData)}}return false},userdata:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.userdata(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.userdata(gridData)}}return false},getDataLen:function(type,gridData){if(type=="json"||type=="xml"){return $.fn.bsgrid.parseData.data(type,gridData).length}return 0},getRecord:function(type,data,row){if(type=="json"){return $.fn.bsgrid.parseJsonData.getRecord(data,row)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.getRecord(data,row)}}return false},getColumnValue:function(type,record,index){if(type=="json"){return $.fn.bsgrid.parseJsonData.getColumnValue(record,index)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.getColumnValue(record,index)}}return false}},buildJsonData:{gridData:function(curPage,data){return{success:true,totalRows:data.length,curPage:curPage,data:data}}},parseJsonData:{success:function(json){return json.success},totalRows:function(json){return json.totalRows},curPage:function(json){return json.curPage},data:function(json){return json.data},userdata:function(json){return json.userdata},getRecord:function(data,row){return data[row]},getColumnValue:function(record,index){return $.trim(record[index])}},buildXmlData:{gridData:function(curPage,data){return'true'+$(""+data+"").find("row").length+""+curPage+""+data+""}},parseXmlData:{success:function(xml){return $.trim($(xml).find("gridData success").text())=="true"},totalRows:function(xml){return parseInt($(xml).find("gridData totalRows").text())},curPage:function(xml){return parseInt($(xml).find("gridData curPage").text())},data:function(xml){return $(xml).find("gridData data row")},userdata:function(xml){return $(xml).find("gridData userdata")},getRecord:function(data,row){return data.eq(row)},getColumnValue:function(record,index){return $.trim(record.find(index).text())}},getPageCondition:function(curPage,options){var params=new StringBuilder();if(options.otherParames==false){}else{if((typeof options.otherParames).toLowerCase()=="string"||options.otherParames instanceof String){params.append("&"+options.otherParames)}else{if(options.otherParames instanceof Array){$.each(options.otherParames,function(i,objVal){params.append("&"+objVal.name+"="+objVal.value)})}else{for(var key in options.otherParames){params.append("&"+key+"="+options.otherParames[key])}}}}var condition=params.length==0?"":params.toString().substring(1);condition+=(condition.length==0?"":"&")+options.settings.requestParamsName.pageSize+"="+options.settings.pageSize+"&"+options.settings.requestParamsName.curPage+"="+curPage+"&"+options.settings.requestParamsName.sortName+"="+options.sortName+"&"+options.settings.requestParamsName.sortOrder+"="+options.sortOrder;return condition},search:function(params,options){if(params!=undefined){options.otherParames=params}else{options.otherParames=false}$.fn.bsgrid.page(1,options)},page:function(curPage,options){if($.trim(curPage)==""||isNaN(curPage)){$.fn.bsgrid.alert($.bsgridLanguage.needInteger);return}var dataType=options.settings.dataType;if(options.settings.localData!=false){if(dataType=="json"){$.fn.bsgrid.loadGridData(dataType,$.fn.bsgrid.buildData.gridData(dataType,curPage,options.settings.localData),options)}else{if(dataType=="xml"){$.fn.bsgrid.loadGridData(dataType,""+$.fn.bsgrid.buildData.gridData(dataType,curPage,options.settings.localData)+"",options)}}return}$.ajax({type:options.settings.ajaxType,url:options.settings.url,data:$.fn.bsgrid.getPageCondition(curPage,options),dataType:dataType,beforeSend:function(XMLHttpRequest){if(options.settings.isProcessLockScreen){$.fn.bsgrid.lockScreen(options)}options.settings.beforeSend(options,XMLHttpRequest)},complete:function(XMLHttpRequest,textStatus){options.settings.complete(options,XMLHttpRequest,textStatus);if(options.settings.isProcessLockScreen){$.fn.bsgrid.unlockScreen(options)}},success:function(gridData,textStatus){$.fn.bsgrid.loadGridData(dataType,gridData,options)},error:function(XMLHttpRequest,textStatus,errorThrown){$.fn.bsgrid.alert($.bsgridLanguage.errorForSendOrRequestData)}})},loadGridData:function(dataType,gridData,options){var parseSuccess=$.fn.bsgrid.parseData.success(dataType,gridData);for(var key in options.settings.extend.beforeRenderGridMethods){options.settings.extend.beforeRenderGridMethods[key](parseSuccess,gridData,options)}options.settings.additionalBeforeRenderGrid(parseSuccess,gridData,options);if(parseSuccess){var userdata=$.fn.bsgrid.parseData.userdata(dataType,gridData);$.fn.bsgrid.storeUserdata(userdata,options);options.settings.processUserdata(userdata,options);var totalRows=parseInt($.fn.bsgrid.parseData.totalRows(dataType,gridData));var curPage=parseInt($.fn.bsgrid.parseData.curPage(dataType,gridData));curPage=Math.max(curPage,1);if(options.settings.pageAll){curPage=1;options.settings.pageSize=totalRows;$("#"+options.noPagingationId).html(totalRows)}var pageSize=options.settings.pageSize;var totalPages=parseInt(totalRows/pageSize);totalPages=parseInt((totalRows%pageSize==0)?totalPages:totalPages+1);var curPageRowsNum=$.fn.bsgrid.parseData.getDataLen(dataType,gridData);curPageRowsNum=curPageRowsNum>pageSize?pageSize:curPageRowsNum;curPageRowsNum=(curPage*pageSize ';$(this).append(sortHtml).find(".sort").click(function(){$.fn.bsgrid.sort($(this).parent("th"),options)})}})},setGridBlankBody:function(options){$.fn.bsgrid.getRows(options).remove();var header=$.fn.bsgrid.getGridHeaderObject(options);var columnsModel=options.columnsModel;for(var hi=0;hi0){var trSb=new StringBuilder();trSb.append("");for(var hi=0;hi ")}trSb.append("
");rowSb=trSb.toString()}var rowsSb=new StringBuilder();var curPageRowsNum=options.settings.pageSize;if(!options.settings.displayBlankRows){curPageRowsNum=options.endRow-options.startRow+1;curPageRowsNum=options.endRow>0?curPageRowsNum:0}if(curPageRowsNum==0){rowsSb.append(''+$.bsgridLanguage.noDataToDisplay+" |
")}else{for(var pi=0;pi');if(options.settings.pageAll){pagingOutTabSb.append($.bsgridLanguage.noPagingation(options.noPagingationId)+" ")}pagingOutTabSb.append(" |
");$("#"+options.gridId).after(pagingOutTabSb.toString())},clearGridBodyData:function(options){$.fn.bsgrid.getRows(options).find("td").html(" ")},addLockScreen:function(options){if($(".bsgrid.lockscreen").length==0){var lockScreenHtml=new StringBuilder();lockScreenHtml.append('');lockScreenHtml.append("
");lockScreenHtml.append('');lockScreenHtml.append('
'+$.bsgridLanguage.loadingDataMessage+" |
");lockScreenHtml.append("
");$("body").append(lockScreenHtml.toString())}},lockScreen:function(options){$(".bsgrid.lockscreen").attr("times",parseInt($(".bsgrid.lockscreen").attr("times"))+1);if($(".bsgrid.lockscreen").css("display")=="none"){$(".bsgrid.lockscreen").show();$(".bsgrid.loading_div").show()}},unlockScreen:function(options){$(".bsgrid.lockscreen").attr("times",parseInt($(".bsgrid.lockscreen").attr("times"))-1);if($(".bsgrid.lockscreen").attr("times")=="0"){setTimeout(function(){$(".bsgrid.lockscreen").hide();$(".bsgrid.loading_div").hide()},50)}},columnTip:function(obj,value,record){$(obj).attr("title",value)},alert:function(msg){try{$.bsgrid.alert(msg)}catch(e){alert(msg)}},longLengthSubAndTip:function(obj,value,maxLen,record){var tip=false;if(value.length>maxLen){try{if(value.indexOf("<")<0||value.indexOf(">")<2||$(value).text().length==0){tip=true}}catch(e){tip=true}}if(tip){$(obj).html(value.substring(0,maxLen-3)+"...");$.fn.bsgrid.columnTip(obj,value,record)}else{$(obj).html(value)}},getPagingObj:function(options){return $.fn.bsgrid.getGridObj(options.gridId).pagingObj},getCurPage:function(options){return $.fn.bsgrid.getPagingObj(options).getCurPage()},refreshPage:function(options){if(!options.settings.pageAll){$.fn.bsgrid.getPagingObj(options).refreshPage()}else{$.fn.bsgrid.page(1,options)}},firstPage:function(options){$.fn.bsgrid.getPagingObj(options).firstPage()},prevPage:function(options){$.fn.bsgrid.getPagingObj(options).prevPage()},nextPage:function(options){$.fn.bsgrid.getPagingObj(options).nextPage()},lastPage:function(options){$.fn.bsgrid.getPagingObj(options).lastPage()},gotoPage:function(options,goPage){$.fn.bsgrid.getPagingObj(options).gotoPage(goPage)},initPaging:function(options){$("#"+options.pagingOutTabId+" td").attr("id",options.pagingId);return $.fn.bsgrid_paging.init(options.pagingId,{gridId:options.gridId,pageSize:options.settings.pageSize,pageSizeSelect:options.settings.pageSizeSelect,pageSizeForGrid:options.settings.pageSizeForGrid,pageIncorrectTurnAlert:options.settings.pageIncorrectTurnAlert,pagingLittleToolbar:options.settings.pagingLittleToolbar,pagingBtnClass:options.settings.pagingBtnClass})},setPagingValues:function(options){$.fn.bsgrid.getPagingObj(options).setPagingValues(options.curPage,options.totalRows)}}})(jQuery);
(function($){$.fn.bsgrid.defaults.extend.settings={supportGridEdit:false,supportGridEditTriggerEvent:"rowClick",supportColumnMove:false,searchConditionsContainerId:"",fixedGridHeader:false,fixedGridHeight:"320px",gridEditConfigs:{text:{build:function(edit,value,record,rowIndex,colIndex,tdObj,trObj,options){return value+''},val:function(formObj){return formObj.val()}},checkbox:{build:function(edit,value,record,rowIndex,colIndex,tdObj,trObj,options){return value+''},val:function(formObj){return formObj.val()}},textarea:{build:function(edit,value,record,rowIndex,colIndex,tdObj,trObj,options){return value+'"},val:function(formObj){return formObj.val()}}}};$.fn.bsgrid.defaults.extend.settings.gridEditConfigs.hidden=$.fn.bsgrid.defaults.extend.settings.gridEditConfigs.text;$.fn.bsgrid.defaults.extend.settings.gridEditConfigs.password=$.fn.bsgrid.defaults.extend.settings.gridEditConfigs.text;$.fn.bsgrid.defaults.extend.settings.gridEditConfigs.radio=$.fn.bsgrid.defaults.extend.settings.gridEditConfigs.text;$.fn.bsgrid.defaults.extend.settings.gridEditConfigs.button=$.fn.bsgrid.defaults.extend.settings.gridEditConfigs.text;$.extend(true,$.fn.bsgrid.defaults.colsProperties,{lineNumberAttr:"w_num",checkAttr:"w_check",editAttr:"w_edit",aggAttr:"w_agg"});$.fn.bsgrid.defaults.event.customCellEditEvents={};$.fn.bsgrid.extendInitGrid={};$.fn.bsgrid.extendBeforeRenderGrid={};$.fn.bsgrid.extendRenderPerRow={};$.fn.bsgrid.extendRenderPerColumn={};$.fn.bsgrid.extendAfterRenderGrid={};$.fn.bsgrid.extendOtherMethods={};$.fn.bsgrid.extendInitGrid.initGridExtendOptions=function(gridId,options){var columnsModel=options.columnsModel;var colsProperties=options.settings.colsProperties;$.fn.bsgrid.getGridHeaderObject(options).each(function(i){columnsModel[i].lineNumber=$.trim($(this).attr(colsProperties.lineNumberAttr));columnsModel[i].check=$.trim($(this).attr(colsProperties.checkAttr));columnsModel[i].edit=$.trim($(this).attr(colsProperties.editAttr))});if($("#"+options.gridId+" tfoot tr td["+colsProperties.aggAttr+"!='']").length!=0){$("#"+options.gridId+" tfoot tr td").each(function(i){columnsModel[i].aggName="";columnsModel[i].aggIndex="";var aggInfo=$.trim($(this).attr(colsProperties.aggAttr));if(aggInfo.length!=0){var aggInfoArray=aggInfo.split(",");columnsModel[i].aggName=aggInfoArray[0].toLocaleLowerCase();columnsModel[i].aggIndex=aggInfoArray.length>1?aggInfoArray[1]:""}})}if($.fn.bsgrid.getGridHeaderObject(options).filter("["+colsProperties.lineNumberAttr+"$='line']").length!=0){options.settings.extend.afterRenderGridMethods.renderLineNumber=$.fn.bsgrid.extendAfterRenderGrid.renderLineNumber}if($.fn.bsgrid.getGridHeaderObject(options).filter("["+colsProperties.checkAttr+"='true']").length!=0){options.settings.extend.initGridMethods.initGridCheck=$.fn.bsgrid.extendInitGrid.initGridCheck;options.settings.extend.renderPerColumnMethods.renderCheck=$.fn.bsgrid.extendRenderPerColumn.renderCheck;options.settings.extend.afterRenderGridMethods.addCheckChangedEvent=$.fn.bsgrid.extendAfterRenderGrid.addCheckChangedEvent}if(options.settings.extend.settings.supportGridEdit){options.settings.extend.renderPerColumnMethods.renderForm=$.fn.bsgrid.extendRenderPerColumn.renderForm;options.settings.extend.afterRenderGridMethods.addGridEditEvent=$.fn.bsgrid.extendAfterRenderGrid.addGridEditEvent;var gridObj=$.fn.bsgrid.getGridObj(gridId);gridObj.activeGridEditMode=function(){return $.fn.bsgrid.defaults.extend.activeGridEditMode(options)};gridObj.getChangedRowsIndexs=function(){return $.fn.bsgrid.defaults.extend.getChangedRowsIndexs(options)};gridObj.getChangedRowsOldRecords=function(){return $.fn.bsgrid.defaults.extend.getChangedRowsOldRecords(options)};gridObj.getRowsChangedColumnsValue=function(){return $.fn.bsgrid.defaults.extend.getRowsChangedColumnsValue(options)};gridObj.deleteRow=function(row){$.fn.bsgrid.defaults.extend.deleteRow(row,options)};gridObj.addNewEditRow=function(){$.fn.bsgrid.defaults.extend.addNewEditRow(options)}}if(options.settings.extend.settings.supportColumnMove){options.settings.extend.initGridMethods.initColumnMove=$.fn.bsgrid.extendInitGrid.initColumnMove}if(options.settings.extend.settings.fixedGridHeader){options.settings.extend.initGridMethods.initFixedHeader=$.fn.bsgrid.extendOtherMethods.initFixedHeader;options.settings.extend.afterRenderGridMethods.fixedHeader=function(parseSuccess,gridData,options){$.fn.bsgrid.extendOtherMethods.fixedHeader(false,options)}}if($.trim(options.settings.extend.settings.searchConditionsContainerId)!=""){options.settings.extend.initGridMethods.initSearchConditions=$.fn.bsgrid.extendInitGrid.initSearchConditions}if($("#"+options.gridId+" tfoot td["+colsProperties.aggAttr+"!='']").length!=0){options.settings.extend.afterRenderGridMethods.aggregation=$.fn.bsgrid.extendAfterRenderGrid.aggregation}};$.fn.bsgrid.extendInitGrid.initGridCheck=function(gridId,options){$.fn.bsgrid.getGridHeaderObject(options).each(function(hi){if(options.columnsModel[hi].check=="true"){if($.trim($(this).html())==""){$(this).html('')}$(this).find("input[type=checkbox]").change(function(){var checked=$.bsgrid.adaptAttrOrProp($(this),"checked")?true:false;$.bsgrid.adaptAttrOrProp($.fn.bsgrid.getRows(options).find("td:nth-child("+(hi+1)+")>input[type=checkbox]"),"checked",checked)})}});var gridObj=$.fn.bsgrid.getGridObj(gridId);gridObj.getCheckedRowsIndexs=function(){return $.fn.bsgrid.defaults.extend.getCheckedRowsIndexs(options)};gridObj.getCheckedRowsRecords=function(){return $.fn.bsgrid.defaults.extend.getCheckedRowsRecords(options)};gridObj.getCheckedValues=function(index){return $.fn.bsgrid.defaults.extend.getCheckedValues(index,options)}};$.fn.bsgrid.extendInitGrid.initSearchConditions=function(gridId,options){var conditionsHtml=new StringBuilder();conditionsHtml.append('");conditionsHtml.append(" ");conditionsHtml.append('');$("#"+options.settings.extend.settings.searchConditionsContainerId).html(conditionsHtml.toString());$("#"+options.settings.extend.settings.searchConditionsContainerId+" select.bsgrid_conditions_select").change(function(){$(this).next("input.bsgrid_conditions_input").attr("name",$(this).val())}).trigger("change")};$.fn.bsgrid.extendInitGrid.initColumnMove=function(gridId,options){if($("#"+options.gridId+" thead tr").length!=1){return}$("#"+options.gridId).css({"table-layout":"fixed"});var headObj=$.fn.bsgrid.getGridHeaderObject(options);var headLen=headObj.length;headObj.each(function(i){var obj=this;$(obj).bind("selectstart",function(){return false});$(obj).css("-moz-user-select","none");$(obj).mousedown(function(){bindDownData(obj,i,headLen)});$(obj).mousemove(function(e){e=e||event;var left=$(obj).offset().left;var nObj=0,nLeft=0;if(i!=headLen-1){nObj=$(obj).next();nLeft=nObj.offset().left}var mObj=obj;if(i!=headLen-1&&e.clientX-nLeft>-10){mObj=nObj}if((i!=0&&e.clientX-left<10)||(i!=headLen-1&&e.clientX-nLeft>-10)){$(obj).css({cursor:"e-resize"});if($.trim($(obj).data("ex_mousedown"))!="mousedown"){return}var mWidth=$(mObj).width();var newMWidth=mWidth-e.clientX+$(mObj).offset().left;var preMWidth=$(mObj).prev().width();var preNewMWidth=preMWidth+e.clientX-$(mObj).offset().left;if(parseInt(newMWidth)>19&&parseInt(preNewMWidth)>19){$(mObj).width(newMWidth).prev().width(preNewMWidth)}}else{$(mObj).css({cursor:"default"});releaseDownData(obj,i,headLen)}});$(obj).mouseup(function(){releaseDownData(obj,i,headLen)});$(obj).mouseout(function(e){e=e||event;var objOffect=$(obj).offset();if(objOffect.top>e.clientY||objOffect.top+$(obj).height()'}}return false};$.fn.bsgrid.extendRenderPerColumn.renderForm=function(record,rowIndex,colIndex,tdObj,trObj,options){if(rowIndexinput[type=checkbox]");checkboxObjs.change(function(){var allCheckboxObjs=$.fn.bsgrid.getRows(options).find("td:nth-child("+(hi+1)+")>input[type=checkbox]");var checked=$.bsgrid.adaptAttrOrProp(checkboxObj,"checked")?true:false;if(!checked&&allCheckboxObjs.filter(":checked").length==allCheckboxObjs.length){$.bsgrid.adaptAttrOrProp(checkboxObj,"checked",true)}else{if(checked&&allCheckboxObjs.filter(":checked").length!=allCheckboxObjs.length){$.bsgrid.adaptAttrOrProp(checkboxObj,"checked",false)}}})}})};$.fn.bsgrid.extendAfterRenderGrid.addGridEditEvent=function(parseSuccess,gridData,options){var gridObj=$.fn.bsgrid.getGridObj(options.gridId);$.fn.bsgrid.getRows(options).filter(":lt("+options.curPageRowsNum+")").each(function(){var columnsModel=options.columnsModel;$(this).find("td").each(function(ci){if(columnsModel[ci].edit!=""){$(this).find(":input").change(function(){var rowObj=$(this).parent("td").parent("tr");var isNew=$.trim(rowObj.data("new"));var value=(isNew=="true"?"":gridObj.getRecordIndexValue(gridObj.getRowRecord(rowObj),columnsModel[ci].index));if($.trim($(this).val())!=value){$(this).addClass("bsgrid_editgrid_change")}else{$(this).removeClass("bsgrid_editgrid_change")}rowObj.data("change",rowObj.find(".bsgrid_editgrid_change").length)})}});if(options.settings.extend.settings.supportGridEditTriggerEvent==""){$(this).find(".bsgrid_editgrid_hidden").each(function(){showCellEdit(this)})}else{if(options.settings.extend.settings.supportGridEditTriggerEvent=="rowClick"){$(this).click(function(){$(this).find(".bsgrid_editgrid_hidden").each(function(){showCellEdit(this)})})}else{if(options.settings.extend.settings.supportGridEditTriggerEvent=="rowDoubleClick"){$(this).dblclick(function(){$(this).find(".bsgrid_editgrid_hidden").each(function(){showCellEdit(this)})})}else{if(options.settings.extend.settings.supportGridEditTriggerEvent=="cellClick"){$(this).find(".bsgrid_editgrid_hidden").each(function(){var formObj=this;$(formObj).parent("td").click(function(){showCellEdit(formObj)})})}else{if(options.settings.extend.settings.supportGridEditTriggerEvent=="cellDoubleClick"){$(this).find(".bsgrid_editgrid_hidden").each(function(){var formObj=this;$(formObj).parent("td").dblclick(function(){showCellEdit(formObj)})})}}}}}});function showCellEdit(formObj){var cloneObj=$(formObj).removeClass("bsgrid_editgrid_hidden").clone(true);$(formObj).parent("td").html(cloneObj)}};$.fn.bsgrid.extendAfterRenderGrid.aggregation=function(parseSuccess,gridData,options){var gridObj=$.fn.bsgrid.getGridObj(options.gridId);var columnsModel=options.columnsModel;$("#"+options.gridId+" tfoot tr td["+options.settings.colsProperties.aggAttr+"!='']").each(function(i){if(columnsModel[i].aggName!=""){var aggName=columnsModel[i].aggName;var val=null;if(aggName=="count"){val=options.curPageRowsNum}else{if(aggName=="countnotnone"||aggName=="sum"||aggName=="avg"||aggName=="max"||aggName=="min"||aggName=="concat"){if(aggName=="countnotnone"){val=0}var valHtml=new StringBuilder();$.fn.bsgrid.getRows(options).filter(":lt("+options.curPageRowsNum+")").each(function(ri){var rval=gridObj.getColumnValue(ri,columnsModel[i].aggIndex);if(rval==""){}else{if(aggName=="countnotnone"){val=(val==null?0:val)+1}else{if(aggName=="sum"||aggName=="avg"){if(!isNaN(rval)){val=(val==null?0:val)+parseFloat(rval)}}else{if(aggName=="max"||aggName=="min"){if(!isNaN(rval)&&(val==null||(aggName=="max"&&parseFloat(rval)>val)||(aggName=="min"&&parseFloat(rval)input:checked").length==1){rowIndexs[rowIndexs.length]=i}});return rowIndexs};$.fn.bsgrid.defaults.extend.getCheckedRowsRecords=function(options){var records=[];$.each($.fn.bsgrid.defaults.extend.getCheckedRowsIndexs(options),function(i,rowIndex){records[records.length]=$.fn.bsgrid.getRecord(rowIndex,options)});return records};$.fn.bsgrid.defaults.extend.getCheckedValues=function(index,options){var values=[];$.each($.fn.bsgrid.defaults.extend.getCheckedRowsRecords(options),function(i,record){values[values.length]=$.fn.bsgrid.getRecordIndexValue(record,index,options)});return values};$.fn.bsgrid.defaults.extend.activeGridEditMode=function(options){if(!options.settings.extend.settings.supportGridEdit){return}$.fn.bsgrid.getRows(options).filter(":lt("+options.curPageRowsNum+")").find("td .bsgrid_editgrid_hidden").each(function(){var cloneObj=$(this).removeClass("bsgrid_editgrid_hidden").clone(true);$(this).parent("td").html(cloneObj)})};$.fn.bsgrid.defaults.extend.getChangedRowsIndexs=function(options){var rowIndexs=[];$.fn.bsgrid.getRows(options).each(function(i){var cellChangedNumStr=$.trim($(this).data("change"));if(!isNaN(cellChangedNumStr)&&parseInt(cellChangedNumStr)>0){rowIndexs[rowIndexs.length]=i}});return rowIndexs};$.fn.bsgrid.defaults.extend.getChangedRowsOldRecords=function(options){var records=[];$.each($.fn.bsgrid.defaults.extend.getChangedRowsIndexs(options),function(i,rowIndex){records[records.length]=$.fn.bsgrid.getRecord(rowIndex,options)});return records};$.fn.bsgrid.defaults.extend.getRowsChangedColumnsValue=function(options){var values={};$.each($.fn.bsgrid.defaults.extend.getChangedRowsIndexs(options),function(i,rowIndex){values["row_"+rowIndex]={};$.fn.bsgrid.getRows(options).filter(":eq("+rowIndex+")").find("td").each(function(ci){if($(this).find(".bsgrid_editgrid_change").length>0){values["row_"+rowIndex][options.columnsModel[ci].index]=options.settings.extend.settings.gridEditConfigs[options.columnsModel[ci].edit].val($(this).find(".bsgrid_editgrid_change"))}})});return values};$.fn.bsgrid.defaults.extend.deleteRow=function(row,options){$.fn.bsgrid.getRow(row,options).remove()};$.fn.bsgrid.defaults.extend.addNewEditRow=function(options){var gridObj=$.fn.bsgrid.getGridObj(options.gridId);if(gridObj.getRows().length<1){return}$("#"+options.gridId+" tbody").prepend(gridObj.getRow(0).clone(true));gridObj.getRowCells(0).each(function(colIndex){var columnModel=options.columnsModel[colIndex];if(columnModel.render!=""){var render_method=eval(columnModel.render);var render_html=render_method(null,0,colIndex,options);$(this).html(render_html)}else{if(columnModel.edit!="textarea"){$(this).children().val("")}else{$(this).children().text("")}$(this).html($(this).children().removeClass("bsgrid_editgrid_change").clone(true)).removeAttr("title")}});gridObj.getRow(0).data("record",null).data("new","true")};$.fn.bsgrid.extendOtherMethods.fixedHeader=function(iFirst,options){if($.trim($("#"+options.gridId+"_fixedDiv").data("fixedGridLock"))=="lock"){return}$("#"+options.gridId+"_fixedDiv").data("fixedGridLock","lock");var headTrNum=$("#"+options.gridId+" thead tr").length;if(!iFirst){headTrNum=headTrNum/2;$("#"+options.gridId+" thead tr:lt("+headTrNum+")").remove()}var fixedGridHeight=getSize(options.settings.extend.settings.fixedGridHeight);if(fixedGridHeight<$("#"+options.gridId).height()){$("#"+options.gridId+"_fixedDiv").height(fixedGridHeight);$("#"+options.gridId).width($("#"+options.gridId+"_fixedDiv").width()-18);$("#"+options.gridId+"_fixedDiv").animate({scrollTop:"0px"},0)}else{$("#"+options.gridId+"_fixedDiv").height($("#"+options.gridId).height());$("#"+options.gridId).width($("#"+options.gridId+"_fixedDiv").width()-1)}$("#"+options.gridId+" thead tr:lt("+headTrNum+")").clone(true).prependTo("#"+options.gridId+" thead");$("#"+options.gridId+" thead tr:lt("+headTrNum+")").css({"z-index":10,position:"fixed"}).width($("#"+options.gridId+" thead tr:last").width());$("#"+options.gridId+" thead tr:lt("+headTrNum+")").each(function(i){var position=$("#"+options.gridId+" thead tr:eq("+(headTrNum+i)+")").position();$(this).css({top:position.top-getSize($(this).find("th").css("border-top-width")),left:position.left})});$("#"+options.gridId+" thead tr:gt("+(headTrNum-1)+")").each(function(ri){$(this).find("th").each(function(i){var thObj=$(this);$("#"+options.gridId+" thead tr:eq("+ri+") th:eq("+i+")").height(thObj.height()+((ri==headTrNum-1)?2:1)*getSize(thObj.css("border-top-width"))).width(thObj.width()+getSize(thObj.css("border-left-width")))})});$("#"+options.gridId+"_fixedDiv").data("fixedGridLock","");function getSize(sizeStr){sizeStr=$.trim(sizeStr).toLowerCase().replace("px","");var sizeNum=parseFloat(sizeStr);return isNaN(sizeNum)?0:sizeNum}};$.fn.bsgrid.extendOtherMethods.initFixedHeader=function(gridId,options){$("#"+gridId).wrap('');$("#"+gridId+"_fixedDiv").data("fixedGridLock","");$("#"+gridId+"_fixedDiv").css({padding:0,"border-width":0,width:"98%","overflow-y":"auto","margin-bottom":"-1px"});$("#"+gridId).css({width:"auto"});$("#"+gridId+"_pt_outTab").css({"border-top-width":"1px"});$.fn.bsgrid.extendOtherMethods.fixedHeader(true,options);$(window).resize(function(){$.fn.bsgrid.extendOtherMethods.fixedHeader(false,options)})}})(jQuery);
(function(a){a.bsgrid_export={defaults:{url:"",exportFileName:"export",colsProperties:{width:100,align:"center",exportAttr:"w_export",indexAttr:"w_index",widthAttr:"width",alignAttr:"w_align"},colWidthPercentmultiplier:14,requestParamsName:{exportFileName:"exportFileName",colNames:"dataNames",colIndexs:"dataIndexs",colWidths:"dataLengths",colAligns:"dataAligns"}},doExport:function(h,o,d){if(o==undefined){o={}}var c={};if(d==undefined){d={}}a.extend(true,c,a.bsgrid_export.defaults,d);var n="",g="",m="",j="";for(var f=0;fthis.length){return false}else{return this.substr(0,a.length)==a}};String.prototype.endWith=function(a){if(a==null||a==""||this.length==0||a.length>this.length){return false}else{return this.substring(this.length-a.length)==a}};String.prototype.replaceAll=function(a,b){return this.replace(new RegExp(a,"gm"),b)};function StringBuilder(){if(arguments.length){this.append.apply(this,arguments)}}StringBuilder.prototype=function(){var c=Array.prototype.join,d=Array.prototype.slice,a=/\{(\d+)\}/g,b=function(){return c.call(this,"")};return{constructor:StringBuilder,length:0,append:Array.prototype.push,appendFormat:function(e){var g=0,f=d.call(arguments,1);this.append(a.test(e)?e.replace(a,function(h,j){return f[j]}):e.replace(/\?/g,function(){return f[g++]}));return this},size:function(){return this.toString().length},toString:b,valueOf:b}}();
-(function(a){a.fn.bsgrid_paging={defaults:{loopback:false,pageSize:20,pageSizeSelect:false,pageSizeForGrid:[5,10,20,25,50,100,200,500],pageIncorrectTurnAlert:true,pagingLittleToolbar:false,pagingBtnClass:"pagingBtn"},pagingObjs:{},init:function(h,g){var d={settings:a.extend(true,{},a.fn.bsgrid_paging.defaults,g),pagingId:h,totalRowsId:h+"_totalRows",totalPagesId:h+"_totalPages",curPageId:h+"_curPage",gotoPageInputId:h+"_gotoPageInput",gotoPageId:h+"_gotoPage",refreshPageId:h+"_refreshPage",pageSizeId:h+"_pageSize",firstPageId:h+"_firstPage",prevPageId:h+"_prevPage",nextPageId:h+"_nextPage",lastPageId:h+"_lastPage",startRowId:h+"_startRow",endRowId:h+"_endRow",totalRows:0,totalPages:0,curPage:1,curPageRowsNum:0,startRow:0,endRow:0};if(g.pageSizeForGrid!=undefined){d.settings.pageSizeForGrid=g.pageSizeForGrid}var b={options:d,page:function(i){a.fn.bsgrid_paging.page(i,d)},getCurPage:function(){return a.fn.bsgrid_paging.getCurPage(d)},refreshPage:function(){a.fn.bsgrid_paging.refreshPage(d)},firstPage:function(){a.fn.bsgrid_paging.firstPage(d)},prevPage:function(){a.fn.bsgrid_paging.prevPage(d)},nextPage:function(){a.fn.bsgrid_paging.nextPage(d)},lastPage:function(){a.fn.bsgrid_paging.lastPage(d)},gotoPage:function(i){a.fn.bsgrid_paging.gotoPage(d,i)},createPagingToolbar:function(){return a.fn.bsgrid_paging.createPagingToolbar(d)},setPagingToolbarEvents:function(){a.fn.bsgrid_paging.setPagingToolbarEvents(d)},dynamicChangePagingButtonStyle:function(){a.fn.bsgrid_paging.dynamicChangePagingButtonStyle(d)},setPagingValues:function(j,i){a.fn.bsgrid_paging.setPagingValues(j,i,d)}};a.fn.bsgrid_paging.pagingObjs[h]=b;a("#"+h).append(b.createPagingToolbar());if(d.settings.pageSizeSelect){if(a.inArray(d.settings.pageSize,d.settings.pageSizeForGrid)==-1){d.settings.pageSizeForGrid.push(d.settings.pageSize)}d.settings.pageSizeForGrid.sort(function(j,i){return j-i});var f=new StringBuilder();for(var e=0;e'+c+"")}a("#"+d.pageSizeId).html(f.toString()).val(d.settings.pageSize)}b.setPagingToolbarEvents();return b},getPagingObj:function(c){var b=a.fn.bsgrid_paging.pagingObjs[c];return b?b:null},page:function(c,b){var d=a.fn.bsgrid.getGridObj(b.settings.gridId);d.options.settings.pageSize=b.settings.pageSize;a.fn.bsgrid.page(c,d.options)},getCurPage:function(b){var c=a("#"+b.curPageId).html();return c==""?1:c},refreshPage:function(b){a.fn.bsgrid_paging.page(a.fn.bsgrid_paging.getCurPage(b),b)},firstPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c<=1){a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isFirstPage);return}a.fn.bsgrid_paging.page(1,b)},prevPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c<=1){if(b.settings.loopback&&b.totalPages>0){a.fn.bsgrid_paging.page(b.totalPages,b);return}else{a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isFirstPage);return}}a.fn.bsgrid_paging.page(parseInt(c)-1,b)},nextPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c>=b.totalPages){if(b.settings.loopback&&c>0){a.fn.bsgrid_paging.page(1,b);return}else{a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isLastPage);return}}a.fn.bsgrid_paging.page(parseInt(c)+1,b)},lastPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c>=b.totalPages){a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isLastPage);return}a.fn.bsgrid_paging.page(b.totalPages,b)},gotoPage:function(b,c){if(c==undefined){c=a("#"+b.gotoPageInputId).val()}if(a.trim(c)==""||isNaN(c)){a.fn.bsgrid_paging.alert(a.bsgridLanguage.needInteger)}else{if(parseInt(c)<1||parseInt(c)>b.totalPages){a.fn.bsgrid_paging.alert(a.bsgridLanguage.needRange(1,b.totalPages))}else{a("#"+b.gotoPageInputId).val(c);a.fn.bsgrid_paging.page(parseInt(c),b)}}},incorrectTurnAlert:function(b,c){if(b.settings.pageIncorrectTurnAlert){a.fn.bsgrid_paging.alert(c)}},alert:function(c){try{a.bsgrid.alert(c)}catch(b){alert(c)}},createPagingToolbar:function(b){var e=new StringBuilder();var c=b.settings.pagingLittleToolbar;e.append('");return e.toString()},setPagingToolbarEvents:function(b){if(b.settings.pageSizeSelect){a("#"+b.pageSizeId).change(function(){b.settings.pageSize=parseInt(a(this).val());a(this).trigger("blur");a.fn.bsgrid_paging.page(1,b)})}a("#"+b.firstPageId).click(function(){a.fn.bsgrid_paging.firstPage(b)});a("#"+b.prevPageId).click(function(){a.fn.bsgrid_paging.prevPage(b)});a("#"+b.nextPageId).click(function(){a.fn.bsgrid_paging.nextPage(b)});a("#"+b.lastPageId).click(function(){a.fn.bsgrid_paging.lastPage(b)});a("#"+b.gotoPageInputId).keyup(function(c){if(c.which==13){a.fn.bsgrid_paging.gotoPage(b)}});a("#"+b.gotoPageId).click(function(){a.fn.bsgrid_paging.gotoPage(b)});a("#"+b.refreshPageId).click(function(){a.fn.bsgrid_paging.refreshPage(b)})},dynamicChangePagingButtonStyle:function(b){var c="disabledCls";if(b.curPage<=1){a("#"+b.firstPageId).addClass(c);a("#"+b.prevPageId).addClass(c)}else{a("#"+b.firstPageId).removeClass(c);a("#"+b.prevPageId).removeClass(c)}if(b.curPage>=b.totalPages){a("#"+b.nextPageId).addClass(c);a("#"+b.lastPageId).addClass(c)}else{a("#"+b.nextPageId).removeClass(c);a("#"+b.lastPageId).removeClass(c)}},setPagingValues:function(i,g,f){i=Math.max(i,1);var b=f.settings.pageSize;var h=parseInt(g/b);h=parseInt((g%b==0)?h:h+1);var e=(i*b");$("#"+gridId).find("tr:lt("+($("#"+gridId+" tr").length-$("#"+gridId+" tfoot tr").length)+")").appendTo($("#"+gridId+" thead"))}if($("#"+gridId).find("tbody").length==0){$("#"+gridId+" thead").after("")}if($("#"+gridId).find("tfoot").length==0){$("#"+gridId).append('')}options.columnsModel=$.fn.bsgrid.initColumnsModel(options);if(settings.pageSizeForGrid!=undefined){options.settings.pageSizeForGrid=settings.pageSizeForGrid}options.settings.dataType=options.settings.dataType.toLowerCase();if(options.settings.pageSizeSelect){if($.inArray(options.settings.pageSize,options.settings.pageSizeForGrid)==-1){options.settings.pageSizeForGrid.push(options.settings.pageSize)}options.settings.pageSizeForGrid.sort(function(a,b){return a-b})}var gridObj={options:options,getPageCondition:function(curPage){return $.fn.bsgrid.getPageCondition(curPage,options)},page:function(curPage){$.fn.bsgrid.page(curPage,options)},search:function(params){$.fn.bsgrid.search(params,options)},loadGridData:function(dataType,gridData){$.fn.bsgrid.loadGridData(dataType,gridData,options)},getPageSize:function(){return options.settings.pageSize},getTotalRows:function(){return options.totalRows},getTotalPages:function(){return options.totalPages},getCurPage:function(){return options.curPage},getCurPageRowsNum:function(){return options.curPageRowsNum},getStartRow:function(){return options.startRow},getEndRow:function(){return options.endRow},getSortName:function(){return options.sortName},getSortOrder:function(){return options.sortOrder},getRows:function(){return $.fn.bsgrid.getRows(options)},getRow:function(row){return $.fn.bsgrid.getRow(row,options)},getRowCells:function(row){return $.fn.bsgrid.getRowCells(row,options)},getColCells:function(col){return $.fn.bsgrid.getColCells(col,options)},getCell:function(row,col){return $.fn.bsgrid.getCell(row,col,options)},getSelectedRow:function(){return $.fn.bsgrid.getSelectedRow(options)},getSelectedRowIndex:function(){return $.fn.bsgrid.getSelectedRowIndex(options)},selectRow:function(row){return $.fn.bsgrid.selectRow(row,options)},unSelectRow:function(){return $.fn.bsgrid.unSelectRow(options)},getUserdata:function(){return $.fn.bsgrid.getUserdata(options)},getRowRecord:function(rowObj){return $.fn.bsgrid.getRowRecord(rowObj)},getAllRecords:function(){return $.fn.bsgrid.getAllRecords(options)},getRecord:function(row){return $.fn.bsgrid.getRecord(row,options)},getRecordIndexValue:function(record,index){return $.fn.bsgrid.getRecordIndexValue(record,index,options)},getColumnValue:function(row,index){return $.fn.bsgrid.getColumnValue(row,index,options)},getCellRecordValue:function(row,col){return $.fn.bsgrid.getCellRecordValue(row,col,options)},sort:function(obj){$.fn.bsgrid.sort(obj,options)},getGridHeaderObject:function(){return $.fn.bsgrid.getGridHeaderObject(options)},getColumnModel:function(colIndex){return $.fn.bsgrid.getColumnModel(colIndex,options)},appendHeaderSort:function(){$.fn.bsgrid.appendHeaderSort(options)},setGridBlankBody:function(){$.fn.bsgrid.setGridBlankBody(options)},createPagingOutTab:function(){$.fn.bsgrid.createPagingOutTab(options)},clearGridBodyData:function(){$.fn.bsgrid.clearGridBodyData(options)},getPagingObj:function(){return $.fn.bsgrid.getPagingObj(options)},getCurPage:function(){return $.fn.bsgrid.getCurPage(options)},refreshPage:function(){$.fn.bsgrid.refreshPage(options)},firstPage:function(){$.fn.bsgrid.firstPage(options)},prevPage:function(){$.fn.bsgrid.prevPage(options)},nextPage:function(){$.fn.bsgrid.nextPage(options)},lastPage:function(){$.fn.bsgrid.lastPage(options)},gotoPage:function(goPage){$.fn.bsgrid.gotoPage(options,goPage)},initPaging:function(){return $.fn.bsgrid.initPaging(options)},setPagingValues:function(){$.fn.bsgrid.setPagingValues(options)}};$.fn.bsgrid.gridObjs[gridId]=gridObj;if(options.settings.pageAll||options.settings.pageSize<1){options.settings.pageAll=true;options.settings.pageSize=0}gridObj.appendHeaderSort();gridObj.createPagingOutTab();if(!options.settings.showPageToolbar){$("#"+options.pagingId).hide();$("#"+options.pagingOutTabId).hide()}if(!options.settings.pageAll){gridObj.pagingObj=gridObj.initPaging();try{var minWidth=$.trim($("#"+options.pagingId).children().width());minWidth=minWidth==""?0:parseInt(minWidth);if(minWidth!=0){$("#"+gridId).css("min-width",minWidth+16);$("#"+options.pagingOutTabId).css("min-width",minWidth+16)}$("#"+options.pagingOutTabId).width($("#"+gridId).width());$(window).resize(function(){$("#"+options.pagingOutTabId).width($("#"+gridId).width())})}catch(e){}}if(options.settings.isProcessLockScreen){$.fn.bsgrid.addLockScreen(options)}try{$.fn.bsgrid.extendInitGrid.initGridExtendOptions(gridId,options)}catch(e){}for(var key in options.settings.extend.initGridMethods){options.settings.extend.initGridMethods[key](gridId,options)}if(options.settings.autoLoad){setTimeout(function(){gridObj.page(1)},10)}else{gridObj.setGridBlankBody()}return gridObj},initColumnsModel:function(options){var columnsModel=[];$.fn.bsgrid.getGridHeaderObject(options).each(function(){var colsProperties=options.settings.colsProperties;var columnModel={};columnModel.sortName="";columnModel.sortOrder="";var sortInfo=$.trim($(this).attr(colsProperties.sortAttr));if(sortInfo.length!=0){var sortInfoArray=sortInfo.split(",");columnModel.sortName=$.trim(sortInfoArray[0]);columnModel.sortOrder=$.trim(sortInfoArray.length>1?sortInfoArray[1]:"")}columnModel.index=$.trim($(this).attr(colsProperties.indexAttr));columnModel.render=$.trim($(this).attr(colsProperties.renderAttr));columnModel.tip=$.trim($(this).attr(colsProperties.tipAttr));var maxLen=$.trim($(this).attr(colsProperties.lengthAttr));columnModel.maxLen=maxLen.length!=0?parseInt(maxLen):colsProperties.maxLength;var align=$.trim($(this).attr(colsProperties.alignAttr));columnModel.align=align==""?colsProperties.align:align;columnModel.hidden=$.trim($(this).attr(colsProperties.hiddenAttr));columnsModel.push(columnModel)});return columnsModel},getGridObj:function(gridId){var obj=$.fn.bsgrid.gridObjs[gridId];return obj?obj:null},buildData:{gridData:function(type,curPage,data){if(type=="json"){return $.fn.bsgrid.buildJsonData.gridData(curPage,data)}else{if(type=="xml"){return $.fn.bsgrid.buildXmlData.gridData(curPage,data)}}return false}},parseData:{success:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.success(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.success(gridData)}}return false},totalRows:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.totalRows(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.totalRows(gridData)}}return false},curPage:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.curPage(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.curPage(gridData)}}return false},data:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.data(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.data(gridData)}}return false},userdata:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.userdata(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.userdata(gridData)}}return false},getDataLen:function(type,gridData){if(type=="json"||type=="xml"){return $.fn.bsgrid.parseData.data(type,gridData).length}return 0},getRecord:function(type,data,row){if(type=="json"){return $.fn.bsgrid.parseJsonData.getRecord(data,row)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.getRecord(data,row)}}return false},getColumnValue:function(type,record,index){if(type=="json"){return $.fn.bsgrid.parseJsonData.getColumnValue(record,index)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.getColumnValue(record,index)}}return false}},buildJsonData:{gridData:function(curPage,data){return{success:true,totalRows:data.length,curPage:curPage,data:data}}},parseJsonData:{success:function(json){return json.success},totalRows:function(json){return json.totalRows},curPage:function(json){return json.curPage},data:function(json){return json.data},userdata:function(json){return json.userdata},getRecord:function(data,row){return data[row]},getColumnValue:function(record,index){return $.trim(record[index])}},buildXmlData:{gridData:function(curPage,data){return'true'+$(""+data+"").find("row").length+""+curPage+""+data+""}},parseXmlData:{success:function(xml){return $.trim($(xml).find("gridData success").text())=="true"},totalRows:function(xml){return parseInt($(xml).find("gridData totalRows").text())},curPage:function(xml){return parseInt($(xml).find("gridData curPage").text())},data:function(xml){return $(xml).find("gridData data row")},userdata:function(xml){return $(xml).find("gridData userdata")},getRecord:function(data,row){return data.eq(row)},getColumnValue:function(record,index){return $.trim(record.find(index).text())}},getPageCondition:function(curPage,options){var params=new StringBuilder();if(options.otherParames==false){}else{if((typeof options.otherParames).toLowerCase()=="string"||options.otherParames instanceof String){params.append("&"+options.otherParames)}else{if(options.otherParames instanceof Array){$.each(options.otherParames,function(i,objVal){params.append("&"+objVal.name+"="+objVal.value)})}else{for(var key in options.otherParames){params.append("&"+key+"="+options.otherParames[key])}}}}var condition=params.length==0?"":params.toString().substring(1);condition+=(condition.length==0?"":"&")+options.settings.requestParamsName.pageSize+"="+options.settings.pageSize+"&"+options.settings.requestParamsName.curPage+"="+curPage+"&"+options.settings.requestParamsName.sortName+"="+options.sortName+"&"+options.settings.requestParamsName.sortOrder+"="+options.sortOrder;return condition},search:function(params,options){options.otherParames=params;$.fn.bsgrid.page(1,options)},page:function(curPage,options){if($.trim(curPage)==""||isNaN(curPage)){$.fn.bsgrid.alert($.bsgridLanguage.needInteger);return}var dataType=options.settings.dataType;if(options.settings.localData!=false){if(dataType=="json"){$.fn.bsgrid.loadGridData(dataType,$.fn.bsgrid.buildData.gridData(dataType,curPage,options.settings.localData),options)}else{if(dataType=="xml"){$.fn.bsgrid.loadGridData(dataType,""+$.fn.bsgrid.buildData.gridData(dataType,curPage,options.settings.localData)+"",options)}}return}$.ajax({type:options.settings.ajaxType,url:options.settings.url,data:$.fn.bsgrid.getPageCondition(curPage,options),dataType:dataType,beforeSend:function(XMLHttpRequest){if(options.settings.isProcessLockScreen){$.fn.bsgrid.lockScreen(options)}options.settings.beforeSend(options,XMLHttpRequest)},complete:function(XMLHttpRequest,textStatus){options.settings.complete(options,XMLHttpRequest,textStatus);if(options.settings.isProcessLockScreen){$.fn.bsgrid.unlockScreen(options)}},success:function(gridData,textStatus){$.fn.bsgrid.loadGridData(dataType,gridData,options)},error:function(XMLHttpRequest,textStatus,errorThrown){$.fn.bsgrid.alert($.bsgridLanguage.errorForSendOrRequestData)}})},loadGridData:function(dataType,gridData,options){var parseSuccess=$.fn.bsgrid.parseData.success(dataType,gridData);for(var key in options.settings.extend.beforeRenderGridMethods){options.settings.extend.beforeRenderGridMethods[key](parseSuccess,gridData,options)}options.settings.additionalBeforeRenderGrid(parseSuccess,gridData,options);if(parseSuccess){var userdata=$.fn.bsgrid.parseData.userdata(dataType,gridData);$.fn.bsgrid.storeUserdata(userdata,options);options.settings.processUserdata(userdata,options);var totalRows=parseInt($.fn.bsgrid.parseData.totalRows(dataType,gridData));var curPage=parseInt($.fn.bsgrid.parseData.curPage(dataType,gridData));curPage=Math.max(curPage,1);if(options.settings.pageAll){curPage=1;options.settings.pageSize=totalRows;$("#"+options.noPagingationId).html(totalRows)}var pageSize=options.settings.pageSize;var totalPages=parseInt(totalRows/pageSize);totalPages=parseInt((totalRows%pageSize==0)?totalPages:totalPages+1);var curPageRowsNum=$.fn.bsgrid.parseData.getDataLen(dataType,gridData);curPageRowsNum=curPageRowsNum>pageSize?pageSize:curPageRowsNum;curPageRowsNum=(curPage*pageSize ';$(this).append(sortHtml).find(".sort").click(function(){$.fn.bsgrid.sort($(this).parent("th"),options)})}})},setGridBlankBody:function(options){$.fn.bsgrid.getRows(options).remove();var header=$.fn.bsgrid.getGridHeaderObject(options);var columnsModel=options.columnsModel;for(var hi=0;hi0){var trSb=new StringBuilder();trSb.append("");for(var hi=0;hi ")}trSb.append("
");rowSb=trSb.toString()}var rowsSb=new StringBuilder();var curPageRowsNum=options.settings.pageSize;if(!options.settings.displayBlankRows){curPageRowsNum=options.endRow-options.startRow+1;curPageRowsNum=options.endRow>0?curPageRowsNum:0}if(curPageRowsNum==0){rowsSb.append(''+$.bsgridLanguage.noDataToDisplay+" |
")}else{for(var pi=0;pi');if(options.settings.pageAll){pagingOutTabSb.append($.bsgridLanguage.noPagingation(options.noPagingationId)+" ")}pagingOutTabSb.append(" |
");$("#"+options.gridId).after(pagingOutTabSb.toString())},clearGridBodyData:function(options){$.fn.bsgrid.getRows(options).find("td").html(" ")},addLockScreen:function(options){if($(".bsgrid.lockscreen").length==0){var lockScreenHtml=new StringBuilder();lockScreenHtml.append('');lockScreenHtml.append("
");lockScreenHtml.append('');lockScreenHtml.append('
'+$.bsgridLanguage.loadingDataMessage+" |
");lockScreenHtml.append("
");$("body").append(lockScreenHtml.toString())}},lockScreen:function(options){$(".bsgrid.lockscreen").attr("times",parseInt($(".bsgrid.lockscreen").attr("times"))+1);if($(".bsgrid.lockscreen").css("display")=="none"){$(".bsgrid.lockscreen").show();$(".bsgrid.loading_div").show()}},unlockScreen:function(options){$(".bsgrid.lockscreen").attr("times",parseInt($(".bsgrid.lockscreen").attr("times"))-1);if($(".bsgrid.lockscreen").attr("times")=="0"){setTimeout(function(){$(".bsgrid.lockscreen").hide();$(".bsgrid.loading_div").hide()},50)}},columnTip:function(obj,value,record){$(obj).attr("title",value)},alert:function(msg){try{$.bsgrid.alert(msg)}catch(e){alert(msg)}},longLengthSubAndTip:function(obj,value,maxLen,record){var tip=false;if(value.length>maxLen){try{if(value.indexOf("<")<0||value.indexOf(">")<2||$(value).text().length==0){tip=true}}catch(e){tip=true}}if(tip){$(obj).html(value.substring(0,maxLen-3)+"...");$.fn.bsgrid.columnTip(obj,value,record)}else{$(obj).html(value)}},getPagingObj:function(options){return $.fn.bsgrid.getGridObj(options.gridId).pagingObj},getCurPage:function(options){return $.fn.bsgrid.getPagingObj(options).getCurPage()},refreshPage:function(options){if(!options.settings.pageAll){$.fn.bsgrid.getPagingObj(options).refreshPage()}else{$.fn.bsgrid.page(1,options)}},firstPage:function(options){$.fn.bsgrid.getPagingObj(options).firstPage()},prevPage:function(options){$.fn.bsgrid.getPagingObj(options).prevPage()},nextPage:function(options){$.fn.bsgrid.getPagingObj(options).nextPage()},lastPage:function(options){$.fn.bsgrid.getPagingObj(options).lastPage()},gotoPage:function(options,goPage){$.fn.bsgrid.getPagingObj(options).gotoPage(goPage)},initPaging:function(options){$("#"+options.pagingOutTabId+" td").attr("id",options.pagingId);return $.fn.bsgrid_paging.init(options.pagingId,{gridId:options.gridId,pageSize:options.settings.pageSize,pageSizeSelect:options.settings.pageSizeSelect,pageSizeForGrid:options.settings.pageSizeForGrid,pageIncorrectTurnAlert:options.settings.pageIncorrectTurnAlert,pagingLittleToolbar:options.settings.pagingLittleToolbar,pagingBtnClass:options.settings.pagingBtnClass})},setPagingValues:function(options){$.fn.bsgrid.getPagingObj(options).setPagingValues(options.curPage,options.totalRows)}}})(jQuery);
+(function(a){a.fn.bsgrid_paging={defaults:{loopback:false,pageSize:20,pageSizeSelect:false,pageSizeForGrid:[5,10,20,25,50,100,200,500],pageIncorrectTurnAlert:true,pagingLittleToolbar:false,pagingBtnClass:"pagingBtn",pagingMinWidth:"auto",pagingBtnShowState:{select:true,first:true,prev:true,next:true,last:true,gotoBtn:true,refresh:true}},pagingObjs:{},init:function(h,g){var d={settings:a.extend(true,{},a.fn.bsgrid_paging.defaults,g),pagingId:h,totalRowsId:h+"_totalRows",totalPagesId:h+"_totalPages",curPageId:h+"_curPage",gotoPageInputId:h+"_gotoPageInput",gotoPageId:h+"_gotoPage",refreshPageId:h+"_refreshPage",pageSizeId:h+"_pageSize",firstPageId:h+"_firstPage",prevPageId:h+"_prevPage",nextPageId:h+"_nextPage",lastPageId:h+"_lastPage",startRowId:h+"_startRow",endRowId:h+"_endRow",totalRows:0,totalPages:0,curPage:1,curPageRowsNum:0,startRow:0,endRow:0};if(g.pageSizeForGrid!=undefined){d.settings.pageSizeForGrid=g.pageSizeForGrid}var b={options:d,page:function(i){a.fn.bsgrid_paging.page(i,d)},getCurPage:function(){return a.fn.bsgrid_paging.getCurPage(d)},refreshPage:function(){a.fn.bsgrid_paging.refreshPage(d)},firstPage:function(){a.fn.bsgrid_paging.firstPage(d)},prevPage:function(){a.fn.bsgrid_paging.prevPage(d)},nextPage:function(){a.fn.bsgrid_paging.nextPage(d)},lastPage:function(){a.fn.bsgrid_paging.lastPage(d)},gotoPage:function(i){a.fn.bsgrid_paging.gotoPage(d,i)},createPagingToolbar:function(){return a.fn.bsgrid_paging.createPagingToolbar(d)},setPagingToolbarEvents:function(){a.fn.bsgrid_paging.setPagingToolbarEvents(d)},dynamicChangePagingButtonStyle:function(){a.fn.bsgrid_paging.dynamicChangePagingButtonStyle(d)},setPagingValues:function(j,i){a.fn.bsgrid_paging.setPagingValues(j,i,d)}};a.fn.bsgrid_paging.pagingObjs[h]=b;a("#"+h).append(b.createPagingToolbar());if(d.settings.pageSizeSelect){if(a.inArray(d.settings.pageSize,d.settings.pageSizeForGrid)==-1){d.settings.pageSizeForGrid.push(d.settings.pageSize)}d.settings.pageSizeForGrid.sort(function(j,i){return j-i});var f=new StringBuilder();for(var e=0;e'+c+"")}a("#"+d.pageSizeId).html(f.toString()).val(d.settings.pageSize)}b.setPagingToolbarEvents();return b},getPagingObj:function(c){var b=a.fn.bsgrid_paging.pagingObjs[c];return b?b:null},page:function(c,b){var d=a.fn.bsgrid.getGridObj(b.settings.gridId);d.options.settings.pageSize=b.settings.pageSize;a.fn.bsgrid.page(c,d.options)},getCurPage:function(b){var c=a("#"+b.curPageId).html();return c==""?1:c},refreshPage:function(b){a.fn.bsgrid_paging.page(a.fn.bsgrid_paging.getCurPage(b),b)},firstPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c<=1){a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isFirstPage);return}a.fn.bsgrid_paging.page(1,b)},prevPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c<=1){if(b.settings.loopback&&b.totalPages>0){a.fn.bsgrid_paging.page(b.totalPages,b);return}else{a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isFirstPage);return}}a.fn.bsgrid_paging.page(parseInt(c)-1,b)},nextPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c>=b.totalPages){if(b.settings.loopback&&c>0){a.fn.bsgrid_paging.page(1,b);return}else{a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isLastPage);return}}a.fn.bsgrid_paging.page(parseInt(c)+1,b)},lastPage:function(b){var c=a.fn.bsgrid_paging.getCurPage(b);if(c>=b.totalPages){a.fn.bsgrid_paging.incorrectTurnAlert(b,a.bsgridLanguage.isLastPage);return}a.fn.bsgrid_paging.page(b.totalPages,b)},gotoPage:function(b,c){if(c==undefined){c=a("#"+b.gotoPageInputId).val()}if(a.trim(c)==""||isNaN(c)){a.fn.bsgrid_paging.alert(a.bsgridLanguage.needInteger)}else{if(parseInt(c)<1||parseInt(c)>b.totalPages){a.fn.bsgrid_paging.alert(a.bsgridLanguage.needRange(1,b.totalPages))}else{a("#"+b.gotoPageInputId).val(c);a.fn.bsgrid_paging.page(parseInt(c),b)}}},incorrectTurnAlert:function(b,c){if(b.settings.pageIncorrectTurnAlert){a.fn.bsgrid_paging.alert(c)}},alert:function(c){try{a.bsgrid.alert(c)}catch(b){alert(c)}},createPagingToolbar:function(b){var e=new StringBuilder();var c=b.settings.pagingLittleToolbar;e.append('");return e.toString()},setPagingToolbarEvents:function(b){if(b.settings.pageSizeSelect){a("#"+b.pageSizeId).change(function(){b.settings.pageSize=parseInt(a(this).val());a(this).trigger("blur");a.fn.bsgrid_paging.page(1,b)})}a("#"+b.firstPageId).click(function(){a.fn.bsgrid_paging.firstPage(b)});a("#"+b.prevPageId).click(function(){a.fn.bsgrid_paging.prevPage(b)});a("#"+b.nextPageId).click(function(){a.fn.bsgrid_paging.nextPage(b)});a("#"+b.lastPageId).click(function(){a.fn.bsgrid_paging.lastPage(b)});a("#"+b.gotoPageInputId).keyup(function(c){if(c.which==13){a.fn.bsgrid_paging.gotoPage(b)}});a("#"+b.gotoPageId).click(function(){a.fn.bsgrid_paging.gotoPage(b)});a("#"+b.refreshPageId).click(function(){a.fn.bsgrid_paging.refreshPage(b)})},dynamicChangePagingButtonStyle:function(b){var c="disabledCls";if(b.curPage<=1){a("#"+b.firstPageId).addClass(c);a("#"+b.prevPageId).addClass(c)}else{a("#"+b.firstPageId).removeClass(c);a("#"+b.prevPageId).removeClass(c)}if(b.curPage>=b.totalPages){a("#"+b.nextPageId).addClass(c);a("#"+b.lastPageId).addClass(c)}else{a("#"+b.nextPageId).removeClass(c);a("#"+b.lastPageId).removeClass(c)}},setPagingValues:function(i,g,f){i=Math.max(i,1);var b=f.settings.pageSize;var h=parseInt(g/b);h=parseInt((g%b==0)?h:h+1);var e=(i*b");$("#"+gridId).find("tr:lt("+($("#"+gridId+" tr").length-$("#"+gridId+" tfoot tr").length)+")").appendTo($("#"+gridId+" thead"))}if($("#"+gridId).find("tbody").length==0){$("#"+gridId+" thead").after("")}if($("#"+gridId).find("tfoot").length==0){$("#"+gridId).append('')}options.columnsModel=$.fn.bsgrid.initColumnsModel(options);if(settings.pageSizeForGrid!=undefined){options.settings.pageSizeForGrid=settings.pageSizeForGrid}options.settings.dataType=options.settings.dataType.toLowerCase();if(options.settings.pageSizeSelect){if($.inArray(options.settings.pageSize,options.settings.pageSizeForGrid)==-1){options.settings.pageSizeForGrid.push(options.settings.pageSize)}options.settings.pageSizeForGrid.sort(function(a,b){return a-b})}var gridObj={options:options,getPageCondition:function(curPage){return $.fn.bsgrid.getPageCondition(curPage,options)},page:function(curPage){$.fn.bsgrid.page(curPage,options)},search:function(params){$.fn.bsgrid.search(params,options)},loadGridData:function(dataType,gridData){$.fn.bsgrid.loadGridData(dataType,gridData,options)},reloadLocalData:function(localData){$.fn.bsgrid.reloadLocalData(localData,options)},getPageSize:function(){return options.settings.pageSize},getTotalRows:function(){return options.totalRows},getTotalPages:function(){return options.totalPages},getCurPage:function(){return options.curPage},getCurPageRowsNum:function(){return options.curPageRowsNum},getStartRow:function(){return options.startRow},getEndRow:function(){return options.endRow},getSortName:function(){return options.sortName},getSortOrder:function(){return options.sortOrder},getRows:function(){return $.fn.bsgrid.getRows(options)},getRow:function(row){return $.fn.bsgrid.getRow(row,options)},getRowCells:function(row){return $.fn.bsgrid.getRowCells(row,options)},getColCells:function(col){return $.fn.bsgrid.getColCells(col,options)},getCell:function(row,col){return $.fn.bsgrid.getCell(row,col,options)},getSelectedRow:function(){return $.fn.bsgrid.getSelectedRow(options)},getSelectedRowIndex:function(){return $.fn.bsgrid.getSelectedRowIndex(options)},selectRow:function(row){return $.fn.bsgrid.selectRow(row,options)},unSelectRow:function(){return $.fn.bsgrid.unSelectRow(options)},getUserdata:function(){return $.fn.bsgrid.getUserdata(options)},getRowRecord:function(rowObj){return $.fn.bsgrid.getRowRecord(rowObj)},getAllRecords:function(){return $.fn.bsgrid.getAllRecords(options)},getRecord:function(row){return $.fn.bsgrid.getRecord(row,options)},getRecordIndexValue:function(record,index){return $.fn.bsgrid.getRecordIndexValue(record,index,options)},getColumnValue:function(row,index){return $.fn.bsgrid.getColumnValue(row,index,options)},getCellRecordValue:function(row,col){return $.fn.bsgrid.getCellRecordValue(row,col,options)},sort:function(obj){$.fn.bsgrid.sort(obj,options)},getGridHeaderObject:function(){return $.fn.bsgrid.getGridHeaderObject(options)},getColumnModel:function(colIndex){return $.fn.bsgrid.getColumnModel(colIndex,options)},appendHeaderSort:function(){$.fn.bsgrid.appendHeaderSort(options)},setGridBlankBody:function(){$.fn.bsgrid.setGridBlankBody(options)},createPagingOutTab:function(){$.fn.bsgrid.createPagingOutTab(options)},clearGridBodyData:function(){$.fn.bsgrid.clearGridBodyData(options)},getPagingObj:function(){return $.fn.bsgrid.getPagingObj(options)},getCurPage:function(){return $.fn.bsgrid.getCurPage(options)},refreshPage:function(){$.fn.bsgrid.refreshPage(options)},firstPage:function(){$.fn.bsgrid.firstPage(options)},prevPage:function(){$.fn.bsgrid.prevPage(options)},nextPage:function(){$.fn.bsgrid.nextPage(options)},lastPage:function(){$.fn.bsgrid.lastPage(options)},gotoPage:function(goPage){$.fn.bsgrid.gotoPage(options,goPage)},initPaging:function(){return $.fn.bsgrid.initPaging(options)},setPagingValues:function(){$.fn.bsgrid.setPagingValues(options)}};$.fn.bsgrid.gridObjs[gridId]=gridObj;if(options.settings.pageAll||options.settings.pageSize<1){options.settings.pageAll=true;options.settings.pageSize=0}gridObj.appendHeaderSort();gridObj.createPagingOutTab();if(!options.settings.showPageToolbar){$("#"+options.pagingId).hide();$("#"+options.pagingOutTabId).hide()}if(!options.settings.pageAll){gridObj.pagingObj=gridObj.initPaging();try{var minWidth=$.trim($("#"+options.pagingId).children().width());minWidth=minWidth==""?0:parseInt(minWidth);if(minWidth!=0){$("#"+gridId).css("min-width",minWidth+16);$("#"+options.pagingOutTabId).css("min-width",minWidth+16)}$("#"+options.pagingOutTabId).width($("#"+gridId).width());$(window).resize(function(){$("#"+options.pagingOutTabId).width($("#"+gridId).width())})}catch(e){}}if(options.settings.isProcessLockScreen){$.fn.bsgrid.addLockScreen(options)}try{$.fn.bsgrid.extendInitGrid.initGridExtendOptions(gridId,options)}catch(e){}for(var key in options.settings.extend.initGridMethods){options.settings.extend.initGridMethods[key](gridId,options)}if(options.settings.autoLoad){setTimeout(function(){gridObj.page(1)},10)}else{gridObj.setGridBlankBody()}return gridObj},initColumnsModel:function(options){var columnsModel=[];$.fn.bsgrid.getGridHeaderObject(options).each(function(){var colsProperties=options.settings.colsProperties;var columnModel={};columnModel.sortName="";columnModel.sortOrder="";var sortInfo=$.trim($(this).attr(colsProperties.sortAttr));if(sortInfo.length!=0){var sortInfoArray=sortInfo.split(",");columnModel.sortName=$.trim(sortInfoArray[0]);columnModel.sortOrder=$.trim(sortInfoArray.length>1?sortInfoArray[1]:"")}columnModel.index=$.trim($(this).attr(colsProperties.indexAttr));columnModel.render=$.trim($(this).attr(colsProperties.renderAttr));columnModel.tip=$.trim($(this).attr(colsProperties.tipAttr));var maxLen=$.trim($(this).attr(colsProperties.lengthAttr));columnModel.maxLen=maxLen.length!=0?parseInt(maxLen):colsProperties.maxLength;var align=$.trim($(this).attr(colsProperties.alignAttr));columnModel.align=align==""?colsProperties.align:align;columnModel.hidden=$.trim($(this).attr(colsProperties.hiddenAttr));columnsModel.push(columnModel)});return columnsModel},getGridObj:function(gridId){var obj=$.fn.bsgrid.gridObjs[gridId];return obj?obj:null},buildData:{gridData:function(type,curPage,data){if(type=="json"){return $.fn.bsgrid.buildJsonData.gridData(curPage,data)}else{if(type=="xml"){return $.fn.bsgrid.buildXmlData.gridData(curPage,data)}}return false}},parseData:{success:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.success(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.success(gridData)}}return false},totalRows:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.totalRows(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.totalRows(gridData)}}return false},curPage:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.curPage(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.curPage(gridData)}}return false},data:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.data(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.data(gridData)}}return false},userdata:function(type,gridData){if(type=="json"){return $.fn.bsgrid.parseJsonData.userdata(gridData)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.userdata(gridData)}}return false},getDataLen:function(type,gridData){if(type=="json"||type=="xml"){return $.fn.bsgrid.parseData.data(type,gridData).length}return 0},getRecord:function(type,data,row){if(type=="json"){return $.fn.bsgrid.parseJsonData.getRecord(data,row)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.getRecord(data,row)}}return false},getColumnValue:function(type,record,index){if(type=="json"){return $.fn.bsgrid.parseJsonData.getColumnValue(record,index)}else{if(type=="xml"){return $.fn.bsgrid.parseXmlData.getColumnValue(record,index)}}return false}},buildJsonData:{gridData:function(curPage,data){return{success:true,totalRows:data.length,curPage:curPage,data:data}}},parseJsonData:{success:function(json){return json.success},totalRows:function(json){return json.totalRows},curPage:function(json){return json.curPage},data:function(json){return json.data},userdata:function(json){return json.userdata},getRecord:function(data,row){return data[row]},getColumnValue:function(record,index){return $.trim(record[index])}},buildXmlData:{gridData:function(curPage,data){return'true'+$(""+data+"").find("row").length+""+curPage+""+data+""}},parseXmlData:{success:function(xml){return $.trim($(xml).find("gridData success").text())=="true"},totalRows:function(xml){return parseInt($(xml).find("gridData totalRows").text())},curPage:function(xml){return parseInt($(xml).find("gridData curPage").text())},data:function(xml){return $(xml).find("gridData data row")},userdata:function(xml){return $(xml).find("gridData userdata")},getRecord:function(data,row){return data.eq(row)},getColumnValue:function(record,index){return $.trim(record.find(index).text())}},getPageCondition:function(curPage,options){var params=new StringBuilder();if(options.otherParames==false){}else{if((typeof options.otherParames).toLowerCase()=="string"||options.otherParames instanceof String){params.append("&"+options.otherParames)}else{if(options.otherParames instanceof Array){$.each(options.otherParames,function(i,objVal){params.append("&"+objVal.name+"="+objVal.value)})}else{for(var key in options.otherParames){params.append("&"+key+"="+options.otherParames[key])}}}}var condition=params.length==0?"":params.toString().substring(1);condition+=(condition.length==0?"":"&")+options.settings.requestParamsName.pageSize+"="+options.settings.pageSize+"&"+options.settings.requestParamsName.curPage+"="+curPage+"&"+options.settings.requestParamsName.sortName+"="+options.sortName+"&"+options.settings.requestParamsName.sortOrder+"="+options.sortOrder;return condition},search:function(params,options){if(params!=undefined){options.otherParames=params}else{options.otherParames=false}$.fn.bsgrid.page(1,options)},page:function(curPage,options){if($.trim(curPage)==""||isNaN(curPage)){$.fn.bsgrid.alert($.bsgridLanguage.needInteger);return}var dataType=options.settings.dataType;if(options.settings.localData!=false){if(dataType=="json"){$.fn.bsgrid.loadGridData(dataType,$.fn.bsgrid.buildData.gridData(dataType,curPage,options.settings.localData),options)}else{if(dataType=="xml"){$.fn.bsgrid.loadGridData(dataType,""+$.fn.bsgrid.buildData.gridData(dataType,curPage,options.settings.localData)+"",options)}}return}$.ajax({type:options.settings.ajaxType,url:options.settings.url,data:$.fn.bsgrid.getPageCondition(curPage,options),dataType:dataType,beforeSend:function(XMLHttpRequest){if(options.settings.isProcessLockScreen){$.fn.bsgrid.lockScreen(options)}options.settings.beforeSend(options,XMLHttpRequest)},complete:function(XMLHttpRequest,textStatus){options.settings.complete(options,XMLHttpRequest,textStatus);if(options.settings.isProcessLockScreen){$.fn.bsgrid.unlockScreen(options)}},success:function(gridData,textStatus){$.fn.bsgrid.loadGridData(dataType,gridData,options)},error:function(XMLHttpRequest,textStatus,errorThrown){$.fn.bsgrid.alert($.bsgridLanguage.errorForSendOrRequestData)}})},loadGridData:function(dataType,gridData,options){var parseSuccess=$.fn.bsgrid.parseData.success(dataType,gridData);for(var key in options.settings.extend.beforeRenderGridMethods){options.settings.extend.beforeRenderGridMethods[key](parseSuccess,gridData,options)}options.settings.additionalBeforeRenderGrid(parseSuccess,gridData,options);if(parseSuccess){var userdata=$.fn.bsgrid.parseData.userdata(dataType,gridData);$.fn.bsgrid.storeUserdata(userdata,options);options.settings.processUserdata(userdata,options);var totalRows=parseInt($.fn.bsgrid.parseData.totalRows(dataType,gridData));var curPage=parseInt($.fn.bsgrid.parseData.curPage(dataType,gridData));curPage=Math.max(curPage,1);if(options.settings.pageAll){curPage=1;options.settings.pageSize=totalRows;$("#"+options.noPagingationId).html(totalRows)}var pageSize=options.settings.pageSize;var totalPages=parseInt(totalRows/pageSize);totalPages=parseInt((totalRows%pageSize==0)?totalPages:totalPages+1);var curPageRowsNum=$.fn.bsgrid.parseData.getDataLen(dataType,gridData);curPageRowsNum=curPageRowsNum>pageSize?pageSize:curPageRowsNum;curPageRowsNum=(curPage*pageSize ';$(this).append(sortHtml).find(".sort").click(function(){$.fn.bsgrid.sort($(this).parent("th"),options)})}})},setGridBlankBody:function(options){$.fn.bsgrid.getRows(options).remove();var header=$.fn.bsgrid.getGridHeaderObject(options);var columnsModel=options.columnsModel;for(var hi=0;hi0){var trSb=new StringBuilder();trSb.append("");for(var hi=0;hi ")}trSb.append("
");rowSb=trSb.toString()}var rowsSb=new StringBuilder();var curPageRowsNum=options.settings.pageSize;if(!options.settings.displayBlankRows){curPageRowsNum=options.endRow-options.startRow+1;curPageRowsNum=options.endRow>0?curPageRowsNum:0}if(curPageRowsNum==0){rowsSb.append(''+$.bsgridLanguage.noDataToDisplay+" |
")}else{for(var pi=0;pi');if(options.settings.pageAll){pagingOutTabSb.append($.bsgridLanguage.noPagingation(options.noPagingationId)+" ")}pagingOutTabSb.append(" |
");$("#"+options.gridId).after(pagingOutTabSb.toString())},clearGridBodyData:function(options){$.fn.bsgrid.getRows(options).find("td").html(" ")},addLockScreen:function(options){if($(".bsgrid.lockscreen").length==0){var lockScreenHtml=new StringBuilder();lockScreenHtml.append('');lockScreenHtml.append("
");lockScreenHtml.append('');lockScreenHtml.append('
'+$.bsgridLanguage.loadingDataMessage+" |
");lockScreenHtml.append("
");$("body").append(lockScreenHtml.toString())}},lockScreen:function(options){$(".bsgrid.lockscreen").attr("times",parseInt($(".bsgrid.lockscreen").attr("times"))+1);if($(".bsgrid.lockscreen").css("display")=="none"){$(".bsgrid.lockscreen").show();$(".bsgrid.loading_div").show()}},unlockScreen:function(options){$(".bsgrid.lockscreen").attr("times",parseInt($(".bsgrid.lockscreen").attr("times"))-1);if($(".bsgrid.lockscreen").attr("times")=="0"){setTimeout(function(){$(".bsgrid.lockscreen").hide();$(".bsgrid.loading_div").hide()},50)}},columnTip:function(obj,value,record){$(obj).attr("title",value)},alert:function(msg){try{$.bsgrid.alert(msg)}catch(e){alert(msg)}},longLengthSubAndTip:function(obj,value,maxLen,record){var tip=false;if(value.length>maxLen){try{if(value.indexOf("<")<0||value.indexOf(">")<2||$(value).text().length==0){tip=true}}catch(e){tip=true}}if(tip){$(obj).html(value.substring(0,maxLen-3)+"...");$.fn.bsgrid.columnTip(obj,value,record)}else{$(obj).html(value)}},getPagingObj:function(options){return $.fn.bsgrid.getGridObj(options.gridId).pagingObj},getCurPage:function(options){return $.fn.bsgrid.getPagingObj(options).getCurPage()},refreshPage:function(options){if(!options.settings.pageAll){$.fn.bsgrid.getPagingObj(options).refreshPage()}else{$.fn.bsgrid.page(1,options)}},firstPage:function(options){$.fn.bsgrid.getPagingObj(options).firstPage()},prevPage:function(options){$.fn.bsgrid.getPagingObj(options).prevPage()},nextPage:function(options){$.fn.bsgrid.getPagingObj(options).nextPage()},lastPage:function(options){$.fn.bsgrid.getPagingObj(options).lastPage()},gotoPage:function(options,goPage){$.fn.bsgrid.getPagingObj(options).gotoPage(goPage)},initPaging:function(options){$("#"+options.pagingOutTabId+" td").attr("id",options.pagingId);return $.fn.bsgrid_paging.init(options.pagingId,{gridId:options.gridId,pageSize:options.settings.pageSize,pageSizeSelect:options.settings.pageSizeSelect,pageSizeForGrid:options.settings.pageSizeForGrid,pageIncorrectTurnAlert:options.settings.pageIncorrectTurnAlert,pagingLittleToolbar:options.settings.pagingLittleToolbar,pagingBtnClass:options.settings.pagingBtnClass})},setPagingValues:function(options){$.fn.bsgrid.getPagingObj(options).setPagingValues(options.curPage,options.totalRows)}}})(jQuery);
diff --git a/donate.html b/donate.html
index 873defd..5d4cba6 100644
--- a/donate.html
+++ b/donate.html
@@ -50,6 +50,7 @@