CFGRID Binding Issue: Element Not Located in CF11 Compared to CF2018

After spending some time tinkering with this issue, I finally found a solution that worked for me. I decided to share it here in the hopes that it might help others save some time.

In ColdFusion 11, my binding parameter looked like this:

<cfset args.bind = 'cfc:data.RecordSelect({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection},"#DataSelect.tableName#","#DataSelect.dsn#",{gridForm:searchColumn},gridForm:searchBox},"#DataSelect.PKName#","#variables.gridColumnsForGrid#")'>

This code ran smoothly on CF11 and mostly works on CF2018 as well. The grid can sort, update, add new records, and delete records without any issues. However, I encountered an error when trying to filter using a dropdown:

Element not found: "gridColumn|gridHeading|gridDataType|gridMask|tableName|PKName|searchable|dsn" [Enable debugging by adding 'cfdebug' to your URL parameters to see more information]

This element refers to the list of columns being passed to the CFC.

Answer №1

Below is the solution provided:

<cfset args.bind = 'cfc:data.RecordSelect({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection},{gridForm:tableName},{gridForm:dsn},{gridForm:searchColumn},{gridForm:searchBox},{gridForm:PKName},{gridForm:gridColumnsForGrid})'>

<cfinput type="hidden" name="tableName" id="tableName" value="#DataSelect.tableName#" />
<cfinput type="hidden" name="dsn" id="dsn" value="#DataSelect.dsn#" />
<cfinput type="hidden" name="PKName" id="PKName" value="#DataSelect.PKName#" />
<cfinput type="hidden" name="gridColumnsForGrid" id="gridColumnsForGrid" value="#variables.gridColumnsForGrid#" />

In my experience, it appears that passing non-bracketed elements via binding is no longer supported. This method seems to work fine in CF11.

I am aware that using CFGRID is discouraged as it may lead to issues, but since this is old code, I will have to postpone converting it to DataTables for now. :)

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the reason for multiple ajax functions being triggered when submitting a form through ajax?

I have a Drupal form with an AJAX submit. Additionally, I have another jQuery $.get function that sends a request every 2 minutes and inserts the response into an HTML element. The form and this JavaScript code are independent of each other, performing sep ...

Is there a way to modify the color of my question post-submission?

Within my code, there are numerous queries that need to be addressed. Upon submission, I desire to alter the color of each question to green if the response is correct, or red if it is incorrect. document.getElementById("submit-button").addEventLi ...

Tips for organizing information within a table

I have been developing a tool that allows users to enter a username, and then I display the data fetched from GitHub related to that particular user. Although each cell in the table is sortable, they all seem to sort data based on the first cell. When I cl ...

As two divs glide across the screen, the top div remains hidden from view

To enhance our user experience, we are tasked with creating a captivating screen saver featuring 3 images. The bottom image will remain fixed in its position. The middle image should move across the screen. Lastly, the top image will move at a faster ...

JavaScript: Working with Nested Callbacks and Retrieving MySQL Data

As I dive into the world of JavaScript server-side code, I find myself grappling with a common issue that many programmers face. In my previous experience with MySQL select queries in PHP, I would simply grab a result and loop through each row, performing ...

Handling errors within classes in JavaScript/TypeScript

Imagine having an interface structured as follows: class Something { constructor(things) { if (things) { doSomething(); } else return { errorCode: 1 } } } Does this code appear to be correct? When using TypeScript, I en ...

Using AngularJS to create interactive popups within leaflet maps

My map uses leafletjs to create markers such as ev124, ev125, and so on. In addition, there are links with a key attribute like <a ng-click="popup(evsi)" key="124">link</a> Using angular, I extract the key value this way: $scope.popup= funct ...

Steps to resolve the issue: The current experimental syntax 'classProperties' is not supported

I encountered an issue where the experimental syntax 'classProperties' is not supported when trying to run my react js application. My goal is to increment the value inside a <span> when a ` button is clicked. Below is the excerpt of my c ...

Attempting to wipe out a request using ajax to access relationship entities in a ruby on rails framework

I'm currently working on implementing an ajax request to delete a "budget" (known as "orçamento" in Portuguese). These budgets are associated with a "cadastre", where each cadastre can have multiple budgets. Below, you can find the components involve ...

Tips for optimizing the performance of a sine wave animation

After experimenting with JavaScript, I've managed to create a visually appealing sine wave animation but it's causing performance issues due to the high number of vectors being generated. My current setup involves utilizing the p5js library. Bel ...

"Exploring the Possibilities with WordPress and Waypoint Js

After exploring various resources and tutorials online, I am struggling to implement Waypoints with WordPress. Despite placing the necessary files like waypoints.min.js and waypoints.js in the designated download folder within the js directory of my templa ...

Run C# script with the assistance of .load jquery

I have searched extensively for similar posts, but none seem to address the specific question I have regarding my project. What I am attempting to do is load different pages (.aspx) in an iframe dynamically. However, instead of using an iframe, I want to r ...

javascript hide rows without data

I have a knack for tweaking existing code to suit my needs, but I'm not very proficient in writing my own from scratch. That being said, here's my current dilemma. My pool league uses a Google sheet to manage a variety of statistics, and with so ...

What is the best way to detect and handle the destroy event in Kendo UI grids when a click event

How can I trigger a function when the delete button in a grid is clicked using JavaScript? ...

What is the solution for the error message "TypeError: app.use() is seeking a middleware function"?

I am a beginner in Node.js and have encountered an issue in my passport.js or signupLogin.js file with the error message, app.use() requires a middleware function that I am struggling to resolve. I suspect it may be related to the signupLogin route, as th ...

How can I retrieve a variable in a JavaScript AJAX POST request?

Similar Question: How to retrieve a variable set during an Ajax request I am facing a challenge, as I am making an ajax call and receiving a number as the response. My query is, how can I assign this returned number to a variable that is accessible ou ...

Tips for executing a function in the HC-Sticky plugin?

Currently, I am utilizing the HC-Sticky JavaScript plugin and endeavoring to utilize the documented reinit method. However, I am facing difficulty in understanding how to execute it. In this CodePen demo, a basic setup is displayed along with an attempt t ...

An error occurs when calling useSWR in a function that is neither a React function component nor a custom React Hook function

When using useSWR to fetch data from an endpoint, I encountered the following error (I only want to fetch data onclick) "useSWR is called in function `fetchUsers` that is neither a React function component nor a custom React Hook function" Error ...

What is the process for incorporating ejs into the source attribute of an image element?

Code Snippet: <img class="card-img-top" alt="..."><%= articles.image %><img> Server Setup: const express = require('express') const app = express() const router = require('./routes/article') app ...

I am working on a NodeJs code that utilizes (Array)Buffers and native readUInt16BE. However, since I am working within a browser context, I plan to opt for DataView.getUint16 instead

While working on adapting a JPEG parsing function in Node.js for use in a browser environment, I discovered that the original code can be found here. The challenge lies in using Node.js' Buffer class. To make it compatible with a browser environment, ...