Open jrperassoli opened 1 week ago
Looking at the code it's just not implemented. Only options passed as properties during instantiation have an effect. And code to update those options doesn't exist. Are you interested in making a PR? Or do you want this to be a feature request for someone else to implement?
If you want to look at writing a PR we can point you in the right directions.
Yep, that's not implemented
Hello, thank you for your quick reply. Yes, I'm interested in making a PR. Could you please tell me which folder I should modify the code in? Thank you.
It'll be in the client_code for the pivot component.
You'll need to add a property for rows. Then you'll need to re-init the jquery pivot table.
If you search jquery pivot table online you'll find documentation for the pivot table. But i think all you need is to call the init table method with the new options.
I looked at some docs and the call to pivotUi will need a third argument set to True which is the override argument.
pivotUI(dom, options, True)
Note the pivot component doesn't store the properties it was given so you'll need to store them.
Some other components store these as self._props
. So if you look at examples that do this then you should also find some properties that update the _props
.
That might not have been clear enough so shout if you need more details.
Does it make sense to include this function?
def update_properties_and_refresh(self, **new_properties):
for prop, value in new_properties.items():
if prop in self.option_names:
self.pivot_options[prop] = value
self._init_pivot() # Re-initialize the pivot table with updated properties
To later call it with:
self.pivot_1.update_properties_and_refresh(rows=["new"], columns=["new"])
I would just call it update. And I would simplify the code as
self.pivot_options.update(new_options)
The code works!
great.
If you need help with creating the PR let us know.
Hi,
I'm attempting to configure the properties of the pivot table using client-side code, but the settings are not applied when the table is loaded. However, these properties work perfectly when adjusted directly from the Anvil IDE. Why don't these settings take effect when made from the client-side code?
Example of code that is not working: