// After the dialog is closed, the form containing the filter input is returned to the popup.
.on( "pagecontainerhide", function( event, data ) {
var listview, form;
// We only handle the disappearance of a dialog generated by a filterable selectmenu
if ( !pageIsSelectmenuDialog( data.toPage ) ) {
return;
}
listview = data.prevPage.jqmData( "listview" ), //THIS IS UNDEFINED
form = listview.jqmData( "filter-form" );
// Put the form back in the popup. It goes ahead of the listview.
listview.before( form );
});
I fix this by using this instead:
.on( "pagecontainerhide", function( event, data ) {
var listview, form;
if ( !fPageIsSelectmenuDialog( data.prevPage ) ) {
return;
}
listview = data.prevPage.jqmData( "listview" );
if(listview)
{
form = listview.jqmData( "filter-form" );
listview.before( form );
}
});
But then I have another problem. If you use the filter, then close the selectmenu and open it again. Clear the filter input, the list is truncated and wrongly positioned.