0
votes

I have CFINPUT text boxes (type= datefield) that are bound to a cfgrid.

When a row is selected the input display from the grid's datastore.

What I would like to do is not use the edit functionality of the grid since there is much coding involved with other controls to render the input boxes and other controls for my page.

I would like that when a change in made in the input text box the cfc is run to insert or update to the database.

Any suggestions?

2

2 Answers

0
votes

I blv you should invoke cfc in the onchange of the cfinput. The code should look like:

function edit(eqp) { Do what ever you like }

The name of the cfgrid is equipmentList

0
votes

You could use cfbind to do this, try something like this,

<cfinput name="inputName" type="text">
<cfinput name="rowID" type="hidden" value="#rowID#">

<cfdiv bind="url:anotherPage.cfm?IName={inputName@keyup}&RId={rowID}" bindOnLoad="false">

----In anotherPage.cfm----
  <cfinvoke
    component="CFC_name"
    method="Method_Name">    
      <cfinvokeargument name="I_Name" value="#trim(IName)#"/>
      <cfinvokeargument name="R_ID" value="#trim(RId)#"/>
 </cfinvoke> 

----In CFC---->
<cffunction name="CFC_name" access="remote">
  <cfargument name="I_Name" type="string" required="yes">
  <cfargument name="R_ID" type="string" required="yes">

  <cfquery name="Q1" datasource="ds">
    UPDATE Tbl1
    SET Col1=<cfqueryparam value="#arguments.I_Name#" cfsqltype="cf_sql_varchar">
    WHERE ID = #arguments.R_ID#
  </cfquery>
</cffunction> 

you could Bind by using, @keyup, @keydown, @change, @click etc.