Select to view content in your preferred language

Show find task results in a DataGrid in AMD

863
4
02-13-2014 10:30 AM
TimWitt
Deactivated User
Hey everybody,

I'm pretty new to the JavaScript API and still have trouble translating legacy to AMD. I try to implement the "Show find task results in a DataGrid" sample into my application, but since it is written with legacy I am having trouble implementing it into my AMD style application.

Does anybody use this sample with their AMD application so I can take a look or maybe look at my application and see the mistakes I made?



Thanks in advance!!

Tim
0 Kudos
4 Replies
JohnGravois
Deactivated User
i actually rewrote this the other day. 
http://jsfiddle.net/jagravois/s5Y83/

we'll be updating the live sample at some point too.
0 Kudos
TimWitt
Deactivated User
Thanks for the link John, guess I'll be fighting through it tomorrow 🙂
0 Kudos
TimWitt
Deactivated User
Hey John,

I have noticed that the zoom function is not working, when clicking on an item in the grid. What would I need to change in the code to achieve that?

Thanks,

Tim
0 Kudos
JohnGravois
Deactivated User
good catch tim.

in the console, an uncaught exception was being thrown when trying to call grid.getItem() because 'grid' was not defined.  comparing back to the original sample, i could see that we need to dig into the object returned by the event itself for our grid, so:

var clickedTaxLotId = grid.getItem(evt.rowIndex).PARCELID;
//needs to be
var clickedTaxLotId = evt.grid.getItem(evt.rowIndex).PARCELID;


sorry about that, not sure how i missed it the first time.
0 Kudos