Collapsible: refresh method missing #3771

Closed
phillpafford opened this Issue Mar 8, 2012 · 20 comments

Comments

@phillpafford

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:

@ghost ghost assigned gseguin Mar 9, 2012

@johnbender

This comment has been minimized.

Show comment
Hide comment
@johnbender

johnbender Mar 10, 2012

Contributor

@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.

Contributor

johnbender commented Mar 10, 2012

@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.

@phillpafford

This comment has been minimized.

Show comment
Hide comment
@phillpafford

phillpafford Mar 10, 2012

@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)

@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)

@johnbender

This comment has been minimized.

Show comment
Hide comment
@johnbender

johnbender Mar 11, 2012

Contributor

@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.

Contributor

johnbender commented Mar 11, 2012

@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.

@toddparker

This comment has been minimized.

Show comment
Hide comment
@toddparker

toddparker Mar 12, 2012

Contributor

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

Contributor

toddparker commented Mar 12, 2012

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

@toddparker

This comment has been minimized.

Show comment
Hide comment
@toddparker

toddparker Mar 12, 2012

Contributor

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

Contributor

toddparker commented Mar 12, 2012

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

@jakeboone02

This comment has been minimized.

Show comment
Hide comment
@jakeboone02

jakeboone02 Mar 12, 2012

Contributor

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.

Contributor

jakeboone02 commented Mar 12, 2012

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.

@agcolom

This comment has been minimized.

Show comment
Hide comment
@agcolom

agcolom May 26, 2012

Member

@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....

Member

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....

@istrasoft

This comment has been minimized.

Show comment
Hide comment
@istrasoft

istrasoft Jul 13, 2012

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.

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.

@gabrielschulhof

This comment has been minimized.

Show comment
Hide comment
@gabrielschulhof

gabrielschulhof Sep 5, 2012

Contributor

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

Contributor

gabrielschulhof commented Sep 5, 2012

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

@toddparker

This comment has been minimized.

Show comment
Hide comment
@toddparker

toddparker Sep 6, 2012

Contributor

Moving to 1.3

Contributor

toddparker commented Sep 6, 2012

Moving to 1.3

@arschmitz

This comment has been minimized.

Show comment
Hide comment
@arschmitz

arschmitz Nov 20, 2012

Member

Moving to 1.4

Member

arschmitz commented Nov 20, 2012

Moving to 1.4

@Palestinian

This comment has been minimized.

Show comment
Hide comment
@Palestinian

Palestinian Apr 3, 2013

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

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

@jaspermdegroot

This comment has been minimized.

Show comment
Hide comment
@jaspermdegroot

jaspermdegroot May 10, 2013

Member

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).

Member

jaspermdegroot 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).

@Palestinian

This comment has been minimized.

Show comment
Hide comment
@Palestinian

Palestinian May 10, 2013

'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.

'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.

@cujomalainey

This comment has been minimized.

Show comment
Hide comment
@cujomalainey

cujomalainey Jun 22, 2013

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.

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.

@Palestinian

This comment has been minimized.

Show comment
Hide comment
@cujomalainey

This comment has been minimized.

Show comment
Hide comment
@cujomalainey

cujomalainey Jun 22, 2013

Mine isn't the theme, its that actual content, I erase and reload my
content in the accordion every 10 seconds and have no way to bring back the
accordions.
On Jun 21, 2013 6:09 PM, "Palestinian" notifications@github.com wrote:

@cujomalainey https://github.com/cujomalainey check this fix - theme
only - but it doesn't replace methods like refresh and create.
http://stackoverflow.com/questions/17174675/how-to-change-the-theme-of-collapsible-set-collapsed-object-in-jquerymobile/17175939#17175939


Reply to this email directly or view it on GitHubhttps://github.com/jquery/jquery-mobile/issues/3771#issuecomment-19847129
.

Mine isn't the theme, its that actual content, I erase and reload my
content in the accordion every 10 seconds and have no way to bring back the
accordions.
On Jun 21, 2013 6:09 PM, "Palestinian" notifications@github.com wrote:

@cujomalainey https://github.com/cujomalainey check this fix - theme
only - but it doesn't replace methods like refresh and create.
http://stackoverflow.com/questions/17174675/how-to-change-the-theme-of-collapsible-set-collapsed-object-in-jquerymobile/17175939#17175939


Reply to this email directly or view it on GitHubhttps://github.com/jquery/jquery-mobile/issues/3771#issuecomment-19847129
.

@Palestinian

This comment has been minimized.

Show comment
Hide comment
@Palestinian

Palestinian Jun 22, 2013

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

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

@cujomalainey

This comment has been minimized.

Show comment
Hide comment
@cujomalainey

cujomalainey Jun 22, 2013

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

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

@arschmitz

This comment has been minimized.

Show comment
Hide comment
@arschmitz

arschmitz Aug 7, 2013

Member

closing this as fixed by widget review

Member

arschmitz commented Aug 7, 2013

closing this as fixed by widget review

@arschmitz arschmitz closed this Aug 7, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment