Hello.
I have Ultimate 11.2 and am trying to bind data to a webdatagrid on the client.
I've been all over the place and all the examples show a call the the grid's "applyClientBinding()" method.
However, when I run it I get the following error:
Microsoft JScript runtime error: Object doesn't support property or method 'applyClientBinding'
Here's my code ("result" is the result of an Ajax call and is an array of custom objects):
if (wdg != null) {
wdg.set_dataSource(result);
wdg.applyClientBinding();
}
Please advise.
Thank you,
Mike
Hi Mike,Have you set EnableClientRendering to true? Have you included references to jquery core and jquery templating engine?
regards,David Young
Hi, David.
No, I didn't set EnableClientRendering to True. It's set now. Thanks.
As for jQuery, I have a reference to "jquery-1.4.1.min.js". Is there another reference that I need? Where do I get it?
Thanks,
You need the jQuery templating engine that Microsoft had started to develop. It's stuck permanently at Beta apparently. Just search on google for jquery template and you'll find it. It's a plug-in.
-Dave
Dave,
I've downloaded the jQuery templating engine from here: https://github.com/jquery/jquery-tmpl/downloads
I've added a refrence to it and now get this error: Microsoft JScript runtime error: Object doesn't support property or method 'tmpl'
What am I missing here?
Yes, I'm happy I solved it too. But I had to scour the globe for the solution.
I can't find anywhere in your documentation that states that an initial setting of the DataSource followed by a DataBind is necessary.
Can you?
Hello milop,
Nice to see that you solved this.
If you need any further assistance do not hesitate to contact us.
Thank you for posting in our community.
Sincerely,
Georgi Sashev
Developer Support Engineer
Infragistics, Inc.
http://es.infragistics.com/support
I figured it out with the help of this post: http://forums.infragistics.com/forums/p/48035/258449.aspx
After adding all of the required .js files as I mentioned in my last post, the last thing that was missing was #3 from that post, with the addition of .DataBind().
Hi, Dave.
Ok, I made some changes: I change the jQuery version from 1.4.1 to 1.7.1, I've added jquery-ui.min.js, added jquery.tmpl.js from IG's sample directory, and added ig.ui.min.js.
I don't get that error anymore, but the grid is not displaying any data.
The data is returned from an embedded WCF service that I have in the web app. It's a list of a custom object (which ultimately translates to an array). The .Net framework is taking care of the serialization through "System.ServiceModel.Activation.WebScriptServiceHostFactory". So, in Fiddler, I can see the JSON; the thing is when the callback method for successful completion is made, the returned data is an array of Object.
Could that be a problem?
That is a good question Mike. You should just need the code and setting of the property. Did you add template plug-in after jquery core? Could you attach a small website here that reproduces it?