Have an editable cfgrid with a search filter that seems to be functioning as 
expected.  I am receiving an extjs error when the filter (correctly) shows no 
results with a blank grid.    

Error: Uncaught TypeError: Cannot read property 'id' of undefined 
(http://localhost:8500/CFIDE/scripts/ajax/ext/ext-all.js, line 18)

I sanitized and clipped some of the code.  Mostly put together by this tutorial 
http://www.forta.com/blog/index.cfm/2007/6/25/ColdFusion-Ajax-Tutorial-6-Editable-Data-Grids
 There are also an edit and a delete function in the cfc which I don't think 
the problem is in b/c I still get the error when they are entirely removed.

grid2.cfm


<cfform id="fgrid" onsubmit="return false;">
        <!---search table --->
                <table class="table" id="tsearchform">
                                <tr>                                            
                                                                
                                        <td class="col1">
                                                <input type="number"  
id="searchcolumn1" value="" class="form-control" name="column1" />
                                        </td>
                                        <td class="col1">
                                                <input type="number" 
id="searchcolumn2" value="" class="form-control" name="column2"  />        
                                        </td>
            </table>
<!---grid--->
<cfgrid name="dashboard_grid" 
        height=720
        width=1114
        fontsize="13px"
        autowidth="no" 
        vspace=10 
        pagesize="30"
        selectmode="edit"  
        insert="Yes" 
        style="border:none"
        delete="Yes"
        rowHeaders="false"
        format="html"
        bind="cfc:grid2.getdashboard(
                {cfgridpage},
                {cfgridpagesize},
                {cfgridsortcolumn},
                {cfgridsortdirection},
                {fgrid:searchcolumn1},
            {fgrid:searchcolumn2}
                )"
        
onchange="cfc:grid2.editDashboard({cfgridaction},{cfgridrow},{cfgridchanged})"
        >       
    </cfgrid> 
</cfform>
</div>


grid2.cfc

<cfcomponent>
<cffunction name="getdashboard" access="remote" returntype="struct">
        <cfargument name="page" required="true" />
        <cfargument name="pageSize" required="true" />
        <cfargument name="gridsortcolumn" required="false" />
        <cfargument name="gridsortdirection" required="false" />
        <cfargument name="searchcolumn1" required="false" type="string" hint="" 
/>
        <cfargument name="searchcolumn2" required="false" type="string" hint="" 
/>
    <cfset getdashboard = queryNew("") />
        
        <cfif arguments.gridsortcolumn eq "" >
                <cfset arguments.gridsortcolumn = "column1" />
                <cfset arguments.gridsortdirection = "asc" />
        </cfif>

      <cfquery name="q1dashboard" dataSource="sqldb" 
cachedwithin=#CreateTimeSpan(0,1,0,0)# result="result">
        DECLARE @column1 varchar(30), @column2 varchar(30)
        SET @column1 = <cfqueryparam cfsqltype="cf_sql_varchar" 
value="#arguments.searchcolumn1#"/>
                SET @column2 = <cfqueryparam cfsqltype="cf_sql_varchar" 
value="#arguments.searchcolumn2#"/>
        SELECT p.column1, p.column2,  p.column4, p.column5, tbl2.column4, 
tbl3.column1, tbl3.column2, tbl4.column2, p.column6, p.column7, p.column8
                FROM tbl1 as P
                INNER JOIN tbl2 ON p.column4 = tbl2.column1
                INNER JOIN tbl3 ON p.column5 = tbl3.column1
                INNER JOIN tbl4 ON p.column6 = tbl4.column1
        WHERE (@column1 ='' OR p.column1 = @column1)
        AND (@column2 ='' OR p.column2 = @column2) 
        ORDER by #arguments.gridsortcolumn# #arguments.gridsortdirection#
       </cfquery>

        <cfreturn queryconvertforgrid(q1dashboard, page, pagesize) />
</cffunction>
</cfcomponent> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:6116
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm

Reply via email to