Skip to content
This repository

Collapsible: refresh method missing #3771

Closed
phillpafford opened this Issue March 08, 2012 · 20 comments
Phill Pafford

jQM Docs say I should be able to update the layout on a collapsible

Trying to update the theme and collapsed data attributes and refreshing/updating the collapsible is not working

Example:

Related:

John Bender

@phillpafford

First, thanks for the fiddle. It's rare and always appreciated.

In general we support this type of activity through refresh methods triggered through the plugin system:

$( "foo" ).collapsible( "refresh" );

The update layout is meant, I think, mostly for you to bind to to know when you should update custom widgets or components in the page. Not as a mechanism for telling our components to update. Though I can sympathize with the confusion.

To support this we'd have to add a refresh or collapse method to the widget and that's not likely to happen before 1.1 final.

@gseguin @toddparker

Feel free to weigh in here.

Phill Pafford

@johnbender Thanks for the update but to my knowledge there is no refresh method on collapsible:

Uncaught no such method 'refresh' for collapsible widget instance

And as for the update layout event I thought this was to tell other elements to adjust there size

can also manually trigger this updatelayout event to ensure components on the page update in response to the changes

Since I wanted to dynamically update the collapsible (collapsible state) and theme (Which the code updates just not the layout)

John Bender

@phillpafford

Correct on the first point, as I said:

To support this we'd have to add a refresh or collapse method to the widget and that's not likely to happen before 1.1 final.

As for the docs we should certainly clarify them.

Todd Parker

Moving this to 1.2 because we should into adding this when we can.

Todd Parker

@jakeboone02 - Maybe you can look at updating collapsibles and collapsible sets to use the API page style docs?

Jake Boone

I'm on a business trip for the next few weeks but if I have some down time I'll see if I can sneak it in.

Anne-Gaelle Colom
Collaborator
agcolom commented May 26, 2012

@phillpafford @toddparker : @jakeboone02 has updated the docs with the missing information on this. Are we now ok to close?

[EDIT]: Sorry, please ignore my comment... We still need the refresh method for the collapsibles....

Alexander

Actually, something that does work is to run a $('#myCollapsible').trigger('click'); even though it is not as clean as a refresh would be, it produces the same result.

Gabriel "_|Nix|_" Schulhof
Collaborator

This falls within the on-the-fly options work, along with #4317.

Todd Parker

Moving to 1.3

Alexander Schmitz
Collaborator

Moving to 1.4

Omar M. T.

Even .trigger('create') or ('refresh') does nothing to collapsibles.

http://jsfiddle.net/Palestinian/gMLsU/

When using collapsible('refresh') I get this error:

Uncaught Error: no such method 'refresh' for collapsible widget instance

Jasper de Groot
Owner
uGoMobi commented May 10, 2013

Dynamically setting option "collapsed" has been fixed by commit 133c81a but we still need to add a refresh method.
See: http://jsbin.com/owasir/52/edit

Trigger "create" works on the container, but not on the element itself.
@gabrielschulhof @arschmitz - Is this a bug? I thought you could also trigger it on the element itself, but I also tested this with a listview and there it doesn't work either. So maybe I am wrong.

Update: I thought wrong... this is not a bug, but intentional.

Changing the title of this ticket (original: Can't set 'data-collapsed' and 'data-theme' dynamically).

Omar M. T.

'Pagecreate' would fix it? Honestly I didn't try. Another issue, adding listview dynamically to a static panel works with .trigger('pagecreate') but doesn't work with .listview('refresh').

Edit: updatelayout doesn't work either.

Curtis

Is there any chance this method could be removed from the API docs until it is complete or have a warning beside it because im sure I'm not the only one scratching his head after copying directly from the API DOCs and still getting and error.

Curtis
Omar M. T.

@cujomalainey have you tried trigger('create');?

Curtis

@Palestinian Thanks, i read through the feed and must have missed that. That saves me a huge pile or work

Alexander Schmitz arschmitz closed this August 06, 2013
Alexander Schmitz
Collaborator

closing this as fixed by widget review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.