[Feature proposal] Adding a parameter to fnDrawCallback
[Feature proposal] Adding a parameter to fnDrawCallback
Hi,
I am in a situation where I need to perform either full or partial re-draws of a table, and have a couple of "chained" tables, i.e. when selecting a row in one table it re-draws a second table (re-drawing is what I have found to be the best way of refreshing data when using the server-side data provisioning mechanism).
In order to "chain" the tables, I added a fnDrawCallBack in the first table that triggers a full refresh of the second table (because the data in the second table may entirely changed based on what's selected in the first one). This is allright as long as I don't want a partial re-draw of the second table.
When I want to only trigger a partial re-draw of the second table however (because some information got updated but the selection in both tables stays the same), I lack the information "this is a partial re-draw" in fnDrawCallBack.
Thus, my proposal would be to add a boolean parameter to fnDrawCallBack which indicates whether one has called fnDraw(true) or fnDraw(false).
What do you think, does it make sense / would it be possible to implement it?
Thanks!
Manuel
I am in a situation where I need to perform either full or partial re-draws of a table, and have a couple of "chained" tables, i.e. when selecting a row in one table it re-draws a second table (re-drawing is what I have found to be the best way of refreshing data when using the server-side data provisioning mechanism).
In order to "chain" the tables, I added a fnDrawCallBack in the first table that triggers a full refresh of the second table (because the data in the second table may entirely changed based on what's selected in the first one). This is allright as long as I don't want a partial re-draw of the second table.
When I want to only trigger a partial re-draw of the second table however (because some information got updated but the selection in both tables stays the same), I lack the information "this is a partial re-draw" in fnDrawCallBack.
Thus, my proposal would be to add a boolean parameter to fnDrawCallBack which indicates whether one has called fnDraw(true) or fnDraw(false).
What do you think, does it make sense / would it be possible to implement it?
Thanks!
Manuel
This discussion has been closed.
Replies
However, can't you just set a flag? You know if you are passing in true or false to the function - just set a flag when you do so and then act on that in fnDrawCallback.
Allan
I looked at the code, as far as my understanding goes, what my proposal would mean is to add a parameter to the _fnDraw( oSettings ) function that indicates whether it has been called due to a re-draw or due to a full draw. Then, this value could also be passed to the callback...I think.
That being said, I am not sure how big would be the impact of such a change, I just quickly glanced at the source (very well documented, by the way).
I'll look into setting a flag for the moment, thanks for the hint!
Manuel
Allan