Pages

Thursday, July 22, 2010

Update to the Javascript Grid Editor documentation.

The "Advanced Scenarios" section of the Javascript Grid Editor's documentation has been updated with a new write-up on how to dynamically specify configuration parameters for related views. This will hopefully address the issue of how to use the JGE in associated or embedded views, effectively.

This isn't a code update, as I'm still working on the next update that will give the JGE the ability to work with Money fields, and special "child entities" like the Quote/Order/Invoice Product.

Leon, at this time I've been working very slowly on the developments that would allow this. It's the last "stage" of the code for me before I try to translate it into CRM 2011. All of the work, however, is occurring at home when I actually have contiguous time to focus on it. Expect to see something ironed out by the end of the year.

Al, I appreciate your interest in the JGE project, but must unfortunately report that the holiday season did not offer me any reprieve to invest time into coding. Additionally, some major changes in our family have further limited my renewed efforts to finalize the JGE for CRM 4 before moving onto CRM 2011.

I would like a clarification on one of caveats noted in http://crmentropy.blogspot.com/p/javascript-grid-editor.html"otherwise executing customized javascript that has been placed into the form for the entity it targets".

I want to be able roll-up a amount, located on the JGE records, onto the regarding object's corresponding 'total amount'. Do I have access to the post update event (post Save All button event) from the JGE in order to update my rolled-up total amount? Or, do I have to implement a server-side plug-in that will take care of this calculation?

Since you addressed this question here, rather than offline, I'll answer it here.

Plugin operation will not be affected by using the JGE. All "post-update" registered Plugin code should fire properly. If you want to drive a recalculation on a parenting form, then I suppose the best way would be to hook into the grid's refresh. The grid is refreshed whenever the JGE leaves edit/add modes; this means either a Save, or a Cancel. There is no differentiation between them, and there are no other "events" into which I could conceive hooking.

If it were me, I wouldn't be too concerned about the possibility of recalculating on cancellation of edits, since only writing a value to the "Total Rejected Weight" that is already there won't trigger the "isDirty" property, and therefore shouldn't prompt the user to save changes. I'd look for the grid element within the Iframe from the parent form (might be a lot of DOM traversal), and hook a script into that refresh event that does the following:

1.) Queries child "Paper Roll" records (you can use my Javascript Library scripts for this; don't try to extract the values from the grid... it's messy, and a lot more trouble than its worth); and then,2.) Sum the retrieved "rejected weight" values into the "total rejected weight" field.