/*! * jQuery appendGrid v1.3.1 * https://appendgrid.apphb.com/ * * Copyright 2014 Albert L. * Dual licensed under the LGPL (http://www.gnu.org/licenses/lgpl.html) * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. * * Depends: * jQuery v1.9.1+ * jquery UI v1.10.2+ */ (function(f){var p={caption:null,initRows:3,initData:null,columns:null,i18n:null,idPrefix:null,rowDragging:false,hideButtons:null,hideRowNumColumn:false,buttonClasses:null,customRowButtons:null,customFooterButtons:null,dataLoaded:null,afterRowAppended:null,afterRowInserted:null,afterRowSwapped:null,beforeRowRemove:null,afterRowRemoved:null};var u={type:"text",name:null,value:null,display:null,displayCss:null,cellCss:null,ctrlAttr:null,ctrlProp:null,ctrlCss:null,ctrlClass:null,ctrlOptions:null,uiOption:null,uiTooltip:null,customBuilder:null,customGetter:null,customSetter:null,onClick:null,onChange:null};var q={noColumnInfo:"Cannot initial grid without column information!",elemNotTable:"Cannot initial grid on element other than TABLE!",notInit:"`appendGrid` does not initialized",getValueMultiGrid:"Cannot get values on multiple grid",notSupportMethod:"Method is not supported by `appendGrid`: "};var s={append:"Append Row",removeLast:"Remove Last Row",insert:"Insert Row Above",remove:"Remove Current Row",moveUp:"Move Up",moveDown:"Move Down",rowDrag:"Sort Row",rowEmpty:"This Grid Is Empty"};var k={append:null,removeLast:null,insert:null,remove:null,moveUp:null,moveDown:null,rowDrag:null};var e={append:false,removeLast:false,insert:false,remove:false,moveUp:false,moveDown:false};var j={init:function(N){var J=this;var I,A,M,C,F,B;if(J.length>0){if(!f.isArray(N.columns)||N.columns.length==0){alert(q.noColumnInfo);return J}I=J[0];if(l(I.tagName)||I.tagName!="TABLE"){alert(q.elemNotTable);return J}var E=f.extend({},p,N);f.extend(E,{_uniqueIndex:0,_rowOrder:[],_isDataLoaded:false,_visibleCount:0,_finalColSpan:0,_hideLastColumn:false});if(f.isPlainObject(N.i18n)){E._i18n=f.extend({},s,N.i18n)}else{E._i18n=f.extend({},s)}if(f.isPlainObject(N.buttonClasses)){E._buttonClasses=f.extend({},k,N.buttonClasses)}else{E._buttonClasses=f.extend({},k)}if(f.isPlainObject(N.hideButtons)){E.hideButtons=f.extend({},e,N.hideButtons)}else{E.hideButtons=f.extend({},e)}if(l(E.idPrefix)){if(l(I.id)||I.id==""){E.idPrefix="ag"+new Date().getTime()}else{E.idPrefix=I.id}}A=document.createElement("thead");A.className="ui-widget-header";M=document.createElement("tbody");M.className="ui-widget-content";C=document.createElement("tfoot");C.className="ui-widget-header";f(I).empty().addClass("appendGrid ui-widget").append(A,M,C);F=A.insertRow(-1);if(!E.hideRowNumColumn){B=F.insertCell(-1);B.className="ui-widget-header"}for(var K=0;K").attr({type:"hidden",id:E.idPrefix+"_rowOrder",name:E.idPrefix+"_rowOrder"}).appendTo(B);if(E.hideButtons.append&&E.hideButtons.removeLast&&(!f.isArray(E.customFooterButtons)||E.customFooterButtons.length==0)){F.style.display="none"}else{if(!E.hideButtons.append){f("