anyone's can guide why cfgrid is not working, its ...
# cfml-general
g
anyone's can guide why cfgrid is not working, its a old Site can't use jquery to be honest
Copy code
<cfform>
   <cfgrid name="myGrid" format="html" width="100%" query="queryData" insert="true" update="true" delete="true">
      <cfgridcolumn name="USER_ID" header="USER_ID" width="100">
      <cfgridcolumn name="USERNAME" header="USERNAME" width="100">
      <cfgridcolumn name="FIRSTNAME" header="FIRSTNAME" width="100">
      <cfgridcolumn name="LASTNAME" header="LASTNAME" width="100">
      <cfgridcolumn name="HASHED_PASSWORD" header="HASHED_PASSWORD" width="100">
      <cfgridcolumn name="EMAIL" header="EMAIL" width="100">
      <cfgridcolumn name="CREATED_TMSTP" header="CREATED_TMSTP" width="100">
      <cfgridcolumn name="MODIFIED_TMSTP" header="MODIFIED_TMSTP" width="100">
      <cfgridcolumn name="CREATED_BY" header="CREATED_BY" width="100">
      <cfgridcolumn name="MODIFIED_BY" header="MODIFIED_BY" width="100">
      <cfgridcolumn name="DELETE_TMSTP" header="DELETE_TMSTP" width="100">
      <cfgridcolumn name="DELETED_BY" header="DELETED_BY" width="100">
   </cfgrid>
</cfform>
g
I hate adobe docs as say it works if some one uses html format
If it does not work or not supported why they include in the documentation
a
Is this the same issue: https://tracker.adobe.com/#/view/CF-4212507 ? From superficial reading, there's a work around. BTW, @gsr, you know better these days than to post a question like "anyone's can guide why cfgrid is not working", with no indication of what the error is, etc. You shouldn't still need reminders like this. It might be an idea, @saghosh if the docs were updated to say "it's a bit fucked on CF2018+, but here's a work-around".
g
@Adam Cameron the console showed me nothing and page is just empty so how can I share a code that what went wrong I checked the docs and they say it works the way I define so I was not sure if that could be an issue I find Adobe to be culprit here as they should have updated docs as you say
a
Saying that there is no error is at least something. Explaining what "is not working" actually means is at least something. Things can "not work" in a lot of ways. You are staring at it concluding "it's not working" and there must be some behaviour that doesn't meet your expectations. Tell us that! You know all this stuff already.
👍 3
g
i do, but the cfgrid i shared is very simple with no bindings, i wonder what could be simplest than this which is not making it even render on screen
a
There you go: "not rendering on screen". That is something. That is something to say upfront. because that's different from "there's a JS error" or "there's a CF error" or "some data is formatted wrong" or "some data is missing" or "one of the columns is blank" or "nothing is submitting from the grid" or any number of other things that might constitute "it not working".
👍 3
b
@gsr, which Adobe ColdFusion version are you using? I tested your code on Adobe ColdFusion 2021 Update 12. ColdFusion gave me an error message, saying that "update" is not a valid attribute of the
cfgrid
tag. Also, I think that cfgrid's
width
attribute should be in number of pixels, rather than percent. When I ran the following code, I obtained a grid as expected:
<cfscript>
queryData = queryNew("USER_ID,USERNAME,FIRSTNAME,LASTNAME,HASHED_PASSWORD,EMAIL,CREATED_TMSTP,MODIFIED_TMSTP,CREATED_BY,MODIFIED_BY,DELETE_TMSTP,DELETED_BY", "integer,varchar,varchar,varchar,varchar,varchar,varchar,varchar,integer,integer,varchar,integer");
queryAddRow(queryData,2);
querySetCell(queryData, "USER_ID", 101,1);
querySetCell(queryData, "USERNAME", "jsmith", 1);
querySetCell(queryData, "FIRSTNAME", "John", 1);
querySetCell(queryData, "LASTNAME", "Smith", 1);
querySetCell(queryData, "HASHED_PASSWORD", "jsmith123", 1);
querySetCell(queryData, "EMAIL", "<mailto:jsmith@domain.com|jsmith@domain.com>", 1);
querySetCell(queryData, "CREATED_TMSTP", "01/11/2023", 1);
querySetCell(queryData, "MODIFIED_TMSTP", "02/11/2023", 1);
querySetCell(queryData, "CREATED_BY", "1001", 1);
querySetCell(queryData, "MODIFIED_BY", "1002", 1);
querySetCell(queryData, "DELETE_TMSTP", "03/11/2023", 1);
querySetCell(queryData, "DELETED_BY", "1003", 1);
querySetCell(queryData, "USER_ID", 102,2);
querySetCell(queryData, "USERNAME", "jDoe", 2);
querySetCell(queryData, "FIRSTNAME", "Jane", 2);
querySetCell(queryData, "LASTNAME", "Doe", 2);
querySetCell(queryData, "HASHED_PASSWORD", "jDoe123", 2);
querySetCell(queryData, "EMAIL", "<mailto:jDoe@domain.com|jDoe@domain.com>", 2);
querySetCell(queryData, "CREATED_TMSTP", "01/12/2023", 2);
querySetCell(queryData, "MODIFIED_TMSTP", "02/12/2023", 2);
querySetCell(queryData, "CREATED_BY", "2001", 2);
querySetCell(queryData, "MODIFIED_BY", "2002", 2);
querySetCell(queryData, "DELETE_TMSTP", "03/12/2023", 2);
querySetCell(queryData, "DELETED_BY", "2003", 2);
//writeDump(queryData);
</cfscript>
<cfform>
<cfgrid name="myGrid" format="html"query="queryData" insert="true" delete="true">
<cfgridcolumn name="USER_ID" header="USER_ID" width="100">
<cfgridcolumn name="USERNAME" header="USERNAME" width="100">
<cfgridcolumn name="FIRSTNAME" header="FIRSTNAME" width="100">
<cfgridcolumn name="LASTNAME" header="LASTNAME" width="100">
<cfgridcolumn name="HASHED_PASSWORD" header="HASHED_PASSWORD" width="100">
<cfgridcolumn name="EMAIL" header="EMAIL" width="100">
<cfgridcolumn name="CREATED_TMSTP" header="CREATED_TMSTP" width="100">
<cfgridcolumn name="MODIFIED_TMSTP" header="MODIFIED_TMSTP" width="100">
<cfgridcolumn name="CREATED_BY" header="CREATED_BY" width="100">
<cfgridcolumn name="MODIFIED_BY" header="MODIFIED_BY" width="100">
<cfgridcolumn name="DELETE_TMSTP" header="DELETE_TMSTP" width="100">
<cfgridcolumn name="DELETED_BY" header="DELETED_BY" width="100">
</cfgrid>
</cfform>