Appcelerator.Module.Datatable={modulePath:null,setPath:function(A){this.modulePath=A},getName:function(){return"appcelerator datatable"},getDescription:function(){return"datatable widget"},getVersion:function(){return 1},getSpecVersion:function(){return 1},getAuthor:function(){return"Amro Mousa"},getModuleURL:function(){return"http://www.appcelerator.org"},isWidget:function(){return true},getWidgetName:function(){return"app:datatable"},createDataTable:function(id,pagination_direction){var on_array=[];var parameterMap=$(id).parameterMap;var scope=parameterMap["scope"];var wire=parameterMap["wire"];var sort=parameterMap["sort"];var rowEvenClass=parameterMap["rowEvenClass"];var rowOddClass=parameterMap["rowOddClass"];var width=parameterMap["width"];var add_spacers_to_header=parameterMap["add_spacers_to_header"];var header_array=parameterMap["header_array"];var array=parameterMap["array"];var pagination=parameterMap["pagination"];var maxRows=parseInt(parameterMap["maxRows"]);if(pagination=="true"&&!pagination_direction){pagination_direction="forward";maxRows=maxRows==0?10:maxRows}if(pagination=="false"){maxRows=maxRows==0?array.length:maxRows}parameterMap["maxRows"]=maxRows;var html="";var table_open='
";var table_header_content="";var table_data_content="";var arrow_up_img='';var arrow_down_img='';var spacer_img='';if(add_spacers_to_header){for(var i=0,len=header_array.length;i'+header_info["cell"]+"";if(sort_string!=""){var header_on_expression=header_info["on"]+or+sort_string;on_array.push({"id":id+"_header_"+x,"on":header_on_expression})}table_header_content+=td}table_header_content='";var x=0;var length=maxRows;if(pagination=="true"){if(pagination_direction=="forward"){if($(id).initialLoad){x=$(id).position;$(id).initialLoad=false}else{x=$(id).position+maxRows>=array.length?$(id).position:$(id).position+maxRows}length=x+maxRows>array.length?array.length:x+maxRows}else{if($(id).position-maxRows<0){x=0;length=maxRows>array.length?array.length:maxRows}else{x=$(id).position-maxRows;length=x+maxRows>array.length?array.length:x+maxRows}}$(id).position=x}var xrun=x;for(;xrun';for(var h=0,lenH=header_array.length;h'+cell_value.toString().escapeHTML()+"";table_data_content+=td}table_data_content+=""}html=table_open+table_header_content+table_data_content+table_close;var myidback=id+"_pagination_back";var myidforward=id+"_pagination_forward";if(pagination=="true"){var pag_html="";var myid="'"+id+"'";var forward='"forward"';var backward="'backward'";pag_html=' Showing '+(x+1)+"-"+(length)+" of "+array.length+"
";html=pag_html+html}Appcelerator.Compiler.setHTML(id,html);if(pagination=="true"){$(myidback).onclick=function(){Appcelerator.Module.Datatable.createDataTable(id,"backward")}.bind(this);$(myidforward).onclick=function(){Appcelerator.Module.Datatable.createDataTable(id,"forward")}.bind(this);$(myidback).onmousedown=function(){Appcelerator.Module.Datatable.paginateContinuously(id,"backward")}.bind(this);$(myidforward).onmousedown=function(){Appcelerator.Module.Datatable.paginateContinuously(id,"forward")}.bind(this);$(myidback).onmouseup=function(){Appcelerator.Module.Datatable.stopContinuousPagination(id)}.bind(this);$(myidforward).onmouseup=function(){Appcelerator.Module.Datatable.stopContinuousPagination(id)}.bind(this);$(myidback).onmouseout=function(){Appcelerator.Module.Datatable.stopContinuousPagination(id)}.bind(this);$(myidforward).onmouseout=function(){Appcelerator.Module.Datatable.stopContinuousPagination(id)}.bind(this)}var on_run_array=[];for(var i=0,len=on_array.length;i';var D='';var N='';for(var G=0,K=E.length;G