|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| Question |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: |
<--- THE CFC --->
<cfcomponent displayname="InvoiceMgr" output="false">
<cffunction name="getInvoices" access="remote" output="false" returnformat="json">
<cfargument name="page" required="no" default="1">
<cfargument name="rows" required="no" default="10">
<cfargument name="sidx" required="no" default="">
<cfargument name="sord" required="no" default="ASC">
<cfset var q = "">
<cfquery datasource="andersen" name="q">
SELECT *
FROM invheader
<cfif len(arguments.sidx)>
ORDER BY #arguments.sidx# #arguments.sord#
</cfif>
</cfquery>
<cfreturn queryConvertForJQGRID(q, arguments.page, arguments.rows) />
</cffunction>
<cffunction name="queryConvertForJQGRID" access="package" returntype="struct" output="no">
<cfargument name="q" type="query" required="yes">
<cfargument name="page" type="numeric" required="no" default="1">
<cfargument name="rows" type="numeric" required="no" default="10">
<cfset var result = structnew()>
<cfset var rowStruct = structnew()>
<cfset var col = "">
<cfset result.CURPAGE = arguments.page>
<cfset result.TOTALPAGES = ceiling(arguments.q.recordcount/arguments.rows)>
<cfset result.TOTALROWS = arguments.q.recordcount>
<cfset result.DATA = arraynew(1)>
<cfoutput query="arguments.q" startrow="#(arguments.page-1)*arguments.rows+1#" maxrows="#arguments.rows#">
<cfset rowStruct = structnew()>
<cfset rowStruct.rowid = currentrow>
<cfloop list="#lcase(arguments.q.columnlist)#" index="col">
<cfset rowStruct[col] = arguments.q[col][currentrow]>
</cfloop>
<cfset arrayappend(result.DATA, rowStruct)>
</cfoutput>
<cfreturn result />
</cffunction>
</cfcomponent>
<--- THE GRID --->
<html>
<head>
<title>jqGrid Demo</title>
<link rel="stylesheet" type="text/css" media="screen" href="themes/basic/grid.css" />
<link rel="stylesheet" type="text/css" media="screen" href="themes/jqModal.css" />
<script src="jquery.js" type="text/javascript"></script>
<script src="jquery.jqGrid.js" type="text/javascript"></script>
<script src="js/jqModal.js" type="text/javascript"></script>
<script src="js/jqDnR.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#list").jqGrid({
jsonReader: {
root: "DATA",
page: "CURPAGE",
total: "TOTALPAGES",
records: "TOTALROWS",
repeatitems: false,
id: "rowid"
},
url:'InvoiceMgr.cfc?method=getInvoices',
datatype: 'json',
colNames:['Inv No','Date', 'Amount','Tax','Total','Notes'],
colModel :[
{name:'id',index:'id', width:60, sorttype:"int"},
{name:'invdate',index:'invdate', width:90, sorttype:"date"},
{name:'amount',index:'amount', width:80, align:"right",sorttype:"float"},
{name:'tax',index:'tax', width:80, align:"right",sorttype:"float"},
{name:'total',index:'total', width:80,align:"right",sorttype:"float"},
{name:'note',index:'note', width:150, sortable:false}
],
pager: $('#pager'),
rowNum:10,
rowList:[10,20,30],
sortorder: "desc",
viewrecords: true,
imgpath: 'themes/basic/images',
caption: 'Invoices'
});
});
</script>
</head>
<body>
<table id="list" class="scroll" cellpadding="0" cellspacing="0"></table>
<div id="pager" class="scroll" style="text-align:center;"></div>
</body>
</html>
|
Advertisement
| Hall of Fame |