Skip to content

Accessing the onRendered paramater #129

Closed Answered by s-cork
NicoN13 asked this question in Q&A
Discussion options

You must be logged in to vote

Ok try development dependency
include this in your native libs
<script src="https://cdn.jsdelivr.net/npm/[email protected]/jquery.sparkline.min.js"></script>
And then the formatter should be

from anvil.js.window import jQuery

...
    def sparkline_formatter(self, cell, on_rendered, **params):
        el = cell.getElement()
        def render():
            jQuery(el).sparkline(cell.getValue(), {"width":"100%", "type":"bar"})
        on_rendered(render)

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@NicoN13
Comment options

@s-cork
Comment options

Answer selected by NicoN13
@NicoN13
Comment options

@s-cork
Comment options

@NicoN13
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants