View Full Version : Ext.Direct grid update

26 Aug 2009, 2:34 AM
Just became tired trying to solve correct JSON response from server after grid update..
Getting all the time if Firebug error:

uncaught exception: Ext.data.DataReader: #update received invalid data from server. Please see docs for DataReader#update and review your DataReader configuration.JSON response from server which I tried:

Thank's in advance!

30 Oct 2009, 10:26 AM
the same thing

9 Nov 2009, 4:45 PM
To use:
Create a folder in your CF project, for now i will call it "servicebus". Extract these 3 files into that folder.

After all of your standard page includes for javascript and CSS, link the Api.cfm page.
<script src="servicebus/Api.cfm"></script>
Configure where your router is located in Direct.cfc:
<cfset variables.routerUrl = 'servicebus/Router.cfm' />
When your page now loads it will be creating an api descriptor in a javascript variable called Ext.ss.APIDesc.

You can configure this in the Api.cfm page:
<cfset args['ns'] = "Ext.ss" />
<cfset args['desc'] = "APIDesc" />
In order to start using Ext.Direct on the client side you will now have to add the API Descriptor as a provider within Ext.Direct.
var provider = Ext.Direct.addProvider(Ext.ss.APIDesc);
This is the generic setup, however we have not exposed any of our service CFCs yet. In order to expose a CFC, place it in the servicebus directory and add the ExtDirect meta attribute to the CFC and to each method you want to expose. For example:
<cfcomponent name="Echo" ExtDirect="true" >
<cffunction name="send" ExtDirect="true">
<cfargument name="data" required="true" />

<cfreturn data />
You will now be able to execute the Echo method after importing it (with addProvider).

Ext.ss.Echo.send('sample', function() {
// callback here...