I have used the jQuery template system and have looked at the data link stuff as well, but aside from a few posts on scottgu's blog, I haven't seen any material on using them together.
What I am trying to is bind a collection (from a JSON request) to a template, and have each item in the template bound to the js object that was used to create it. Basically, I want an updatable binding for each object in the collection. I will then post the object back to the server.
Does anyone know if this is possible? Any guidance or examples?
Thanks, Erick
It's only in beta 1 currently. Beta 2 is supposed to be out later this month (Apr), but even over a year after MS dropped it's AJAX Library, the jquery tmpl and datalink plugins are still dramatically far behind and nowhere near as robust. There seem to be issues as well when you stick them together.
I have a project that's been using the MS AJAX Library preview editions sine they came out just tried to convert it over since I thought it'd be better by now to use the jquery replacements. Binding to an array of objects worked with the templating (after finding a correct and decent example) but when I mixed that with datalinking, I found it sorely lacking. Updating a field in one record propagated to the other matching fields from other records, there's no index value outside of the {{each}} operation without having to call inArray as a klooge, you only get a rendered method as an event handler and that's having to use the tmplPlus plugin since the current tmpl author thinks it's only useful in special circumstances, you only gain access to the tmplItem via a selector on an element instead of while rendering which makes it hard to do some trickier bindings, plus you can't find any real accurate examples or documentation worth anything aside from the little bit on the jquery site.
Doing what you want to do is really easy with MS AJAX Library preview 6 and I do it in several production systems currently. Doing that with the jquery plugins as they are now will take some effort if you get into anything beyond simple scenarios. I hate to recommend a non-supported library, but it's way ahead of the jquery tmpl and datalinking plugins now and would offer you more flexibility.
Unfortunately MS seems to have thrown support behind the jquery stuff in a similar way to how they did their Facebook api controls, as in paying a lot of lip service and then tasking one or two people with it but giving them no bandwidth to work on it.