Status/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): / ext-user (Piyush Kumar Nayak)
Created: 02/25/2014
Components: AJAX, UI Components
Versions: 11.0
Failure Type:
Found In Build/Fixed In Build: 288701 /
Priority/Frequency: Major / Some users will encounter
Locale/System: English / Windows 7 SP1 64-bit
Vote Count: 0
Problem: cfgridcolumn : name parameter is not honored with JS binding in grids.
Method:
<!------------------------ test.cfm ----------------------------->
<cfajaxproxy cfc="places" jsclassname="dashboardUser" >
<html>
<head>
<script language="javascript">
GetData = function(page,pagesize,sort,sortdir)
{
var gridProxy = new dashboardUser();
gridProxy.setHTTPMethod("GET");
result = gridProxy.getData(page,pagesize,sort,sortdir);
return result;
}
</script>
</head>
<body>
<cfset variables.gridargs = {
width="400",
bindOnLoad="yes",
bind="javascript:GetData({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})"}>
<cfform name="form01" id="form01">
<cfgrid format="html" name="grid01" attributeCollection="#variables.gridargs#" >
<cfgridcolumn name="Email" display="true" header="Email">
<cfgridcolumn name="LastName" display="true" header="Last Name">
<cfgridcolumn name="Emp_ID" display="true" header="Emp ID" >
<cfgridcolumn name="FirstName" display="true" header="First Name">
</cfgrid>
</cfform>
</body>
</html>
<!------------------------ places.cfc ----------------------------->
<cfcomponent>
<cffunction name="getData" access="remote" output="false">
<cfargument name="page">
<cfargument name="pageSize">
<cfargument name="gridsortcolumn">
<cfargument name="gridstartdirection">
<cfset startRow = (page-1)*pageSize>
<cfset endRow = page*pageSize>
<cfquery name="team" datasource="ajax">
SELECT Emp_ID, FirstName, LastName, EMail
FROM Employees
</cfquery>
<cfreturn QueryConvertForGrid(team, page, pageSize)>
</cffunction>
</cfcomponent>
Result:
observe that the data in the columns are mismatched. For eg. Column 'Email' shows empIDs.
Expected:
The columns should be binded to the names of the query columns specified in the cfgridcolumn:name parameter.
Workaround:n/a
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3712885
External Customer Info:
External Company:
External Customer Name:
External Customer Email:
Attachments:
Comments: