text: 	function pagerFilter(data){
  		if ($.isArray(data)){	// is array
  			data = {
  				total: data.length,
  				rows: data
  			}
  		}
  		var dg = $(this);
  		var state = dg.data('datagrid');
  		var opts = dg.datagrid('options');
  		if (!state.allRows){
  			state.allRows = (data.rows);
  		}
  		var start = (opts.pageNumber-1)*parseInt(opts.pageSize);
  		var end = start + parseInt(opts.pageSize);
  		data.rows = $.extend(true,[],state.allRows.slice(start, end));
  		return data;
  	}
  
  	var loadDataMethod = $.fn.datagrid.methods.loadData;
  	$.extend($.fn.datagrid.methods, {
  		clientPaging: function(jq){
  			return jq.each(function(){
  				var dg = $(this);
                  var state = dg.data('datagrid');
                  var opts = state.options;
                  opts.loadFilter = pagerFilter;
                  var onBeforeLoad = opts.onBeforeLoad;
                  opts.onBeforeLoad = function(param){
                      state.allRows = null;
                      return onBeforeLoad.call(this, param);
                  }
  				dg.datagrid('getPager').pagination({
  					onSelectPage:function(pageNum, pageSize){
  						opts.pageNumber = pageNum;
  						opts.pageSize = pageSize;
  						$(this).pagination('refresh',{
  							pageNumber:pageNum,
  							pageSize:pageSize
  						});
  						dg.datagrid('loadData',state.allRows);
  					}
  				});
                  $(this).datagrid('loadData', state.data);
                  if (opts.url){
                  	$(this).datagrid('reload');
                  }
  			});
  		},
          loadData: function(jq, data){
              jq.each(function(){
                  $(this).data('datagrid').allRows = null;
              });
              return loadDataMethod.call($.fn.datagrid.methods, jq, data);
          },
          getAllRows: function(jq){
          	return jq.data('datagrid').allRows;
          }
  	})
  