Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7580259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:52:21+00:00 2026-05-30T17:52:21+00:00

I’m trying to make ExtJs work with backend running WCF RIA services with JSON

  • 0

I’m trying to make ExtJs work with backend running WCF RIA services with JSON endpoint enabled. The backend I have uses GetXXX for read data and CommitChanges for create/update/delete data. It also has not ExtJs standard message format, so I have store class defined like this:

function cloneObject(src, dst) {
    for (var key in src)
    {
        dst[key] = src[key];
    }


    return dst;
}


Ext.define('MyApp.store.Items', {
    extend: 'Ext.data.Store',
    model: 'MyApp.model.Tax',
    autoLoad: true,
    autoSync: true,    


    proxy: {
        type: 'ajax',
        api: {
            read: '/MyApp/MyAppWeb-Web-MyAppDomain.svc/JSON/GetItems',
            update: '/MyApp/MyAppWeb-Web-MyAppDomain.svc/JSON/SubmitChanges',
            create: '/MyApp/MyAppWeb-Web-MyAppDomain.svc/JSON/SubmitChanges',
            destroy: '/MyApp/MyAppWeb-Web-MyAppDomain.svc/JSON/SubmitChanges'
        },
        reader: {
            type: 'json',
            root: 'GetItemsResult.RootResults',
            successProperty: null,
            totalProperty: 'GetItemsResult.TotalCount'
        },


        writer: {
            type: 'json',
            root: 'changeSet',
            currentOperation: null,


            getRecordData: function(record) {


                var changeSet = [];
                var entity = { 
                    Id: 0, 
                    Operation: 3,
                    Entity: { 
                        __type: 'Items:#MyApp.Web' 
                    },
                    OriginalEntity: {
                        __type: 'Items:#MyApp.Web' 
                    }
                };


                cloneObject(record.data, entity.Entity);
                cloneObject(record.raw, entity.OriginalEntity);
                changeSet.push(entity);


                return changeSet;
            }
        }
    }
});

As you can in order to accomodate Microsoft JSON endpoint format I had to override getRecordData and create custom JSON object. I can probably replace cloneObject function with merge function, right? (I’m still kind of new to ExtJs, so may be I’m trying to “invent a bicycle” here.

It works more or less as expected for update, however for create and delete I need to create slightly different message format. Different Operation code and no need to send OriginalEntity. However inside getRecordData I don’t have information about what kind of operation is being performed. So question #1

What is the best approach here? Override ‘write’ method as well or is there another way?

Question #2. After any update standard store class would call reader in order to parse response, but response for update is very different then response for GetItems and I have no idea how to handle that.

Any suggestions or links to walk-through on how to tie ExtJs and Domain Services?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T17:52:23+00:00Added an answer on May 30, 2026 at 5:52 pm

    I ended up re-writing Proxy class to add support for different parsing for read/write operations. Works pretty well. Let me know if somebody else faces same problems – I will post code samples.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I am trying to loop through a bunch of documents I have to put
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.