Repository navigation
Update Aggrid docs to explain javascript callback handling and details #6344
Replies: 4 comments
|
Hi @csrubin, thanks for writing this up in such detail! Getting stuck on a silent failure is frustrating, and you're right that the AG Grid page shows Two small corrections first, so the docs end up accurate:
Here's what I would change (roughly in order of value):
Would you like to open a PR for this? You already did the hard part, which is understanding what was missing. The docs live in |
|
Hi @csrubin, we went ahead and put the above into a PR: #6362. It adds a section explaining the colon-prefixed JavaScript expressions, clarifies where the row ID for |
|
Hi @falkoschindler, sorry for being MIA. I tried setting up the dev environment to start a PR but got distracted and forgot. Thanks for pushing this through! Happy to continue writing detailed discussions in the future :) |
|
PR #6362 has just been released in version 3.18 ✔️ |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Recently, I spent a lot of time trying to figure out why my aggrid element was not updating properly, and seemingly not successfully calling
run_grid_method()but it was failing "silently" so I couldn't tell what was wrong. Turns out, at first I wasn't defininggetRowIdin the grid options (took a while and lot of aggrid documentation searching to see thatgetRowId()is required for using the grid/row API. When that didn't work, it took even longer to realize that I was missing the preceding colon in options, and I did not understand the necessary usage ofparams. It did not help that AI was producing different responses, couldn't seem to find the error.Wrong:
"getRowId": "params.data.id"Correct:
":getRowId": "params => params.data.id"All that to say, I think there is benefit in adding to the aggrid documentation so others don't fight these issues. For what it's worth, the docs do accurately show
getRowIdandparamsusage, but lacks explanation and clear definition that it is required for things to work.run_grid_methodandrun_row_methodREQUIREgetRowIdto be defined in options so aggrid doesn't get confused about which row to operate onparams, sometimes needing arrow operator=>depending on the situation. WHEREAS, other options (e.g.,rowClassRules) that are not preceded by a colon can usedata.<field>to access attributes of the gridSeparately, I think there is also value in giving tips for debugging when aggrid is not behaving as expected, which can be done with browser-side debugging and console logging.
Here's a link to a (pretty long) conversation I had with ChatGPT where I was finally able to figure out my issues. It gave a lot of really helpful information once I figured out what to ask for. If it is decided to add to the documentation, this conversation can probably help get that going.
All reactions