JQuery & Knockout - A Simple Example

Hi All,

I have been assigned to do some client side stuff. In this case, we have some FAQ contents in CRM back-end and I want to  grab those content and display it in a user control.

End result will look like this:

We extensively use Knockout.js and jQuery in terms of displaying simple content. The advantage of this is that it renders much faster than using server controls. To grab the data we can use POST request to get JSON from the asmx webservice.

Here is an example of displaying FAQCategory. Note that:
1. UPDATE - updated to knockout 2.1.0 . This will use native templating.
2. Grouping is achieved by creating pivot 'associative' array object :)
3. Notice multiple synchronous request? This is because the webservice is using RetrieveMultiple request (CRM 4.0) thus I need to grab attribute from related entity. Then I append the attributes to my result object. (can use FetchXML but more cumbersome in terms of parsing + slower than QueryExpression. Also, you can use jQuery Ajax function as well if you wish to :))
4. It is displayed using collapsible behavior of jQuery :)


Hope this helps,



I have read this post. collection of post is a nice one ..that am doing website designing company chennai india and website development company chennai india. That I will inform about your post to my friends and all the best for your future posts..


Post a Comment