Topener / nl.fokkezb.pullToRefresh

Widget to implement a table pull-to-refresh header in Titanium Alloy
184 stars 60 forks source link

Widget disappear in scrollableview #46

Closed jmosqueda1987 closed 9 years ago

jmosqueda1987 commented 9 years ago

Hi, can you help me, when i have the widget in a scrollable view with other views, this dissappear, You know how it could solve?

Thanks Regards

FokkeZB commented 9 years ago

It only works for table view and list view. Do you have a code example?

jmosqueda1987 commented 9 years ago

Sure, this is my code example

<ScrollableView class="view" id="viewContainer">
       <View class="container1">
        <TextField id="buscar" class="w-size"></TextField>

        <Widget id="ptr" src="nl.fokkezb.pullToRefresh" onRelease="myRefresher">
            <TableView id="ultimas"></TableView>
        </Widget>
    </View>

      <View class="container1">
        <TextField id="buscar" class="w-size"></TextField>

        <Widget id="ptr2" src="nl.fokkezb.pullToRefresh" onRelease="myRefresher2">
            <TableView id="ultimas2"></TableView>
        </Widget>
    </View>
</ScrollableView>

When i have one view it works, but with two views the first view dissapear

Thanks for the answer

Regards

FokkeZB commented 9 years ago

Is this on iOS or Android?

jmosqueda1987 commented 9 years ago

I've only tested on Android, in iOS still I am to try it, regards

FokkeZB commented 9 years ago

I think it's a issue with the module. Please try to reproduce the issue without the widget (or Alloy - so just plain classic Titanium) and if it still exists, report it at the repo of the module instead. If it does seem like a widget but, please reopen.

jmosqueda1987 commented 9 years ago

Hi,

With the classic code works but how I can do the callback to refresh the control, here is my code

var ptr = Alloy.createWidget("nl.fokkezb.pullToRefresh", {
        id : "ptr",
        children : [tableview]
    }).getView();

    ptr.addEventListener("onRelease",function(e){
        alert("");
    });

Regards

FokkeZB commented 9 years ago

Alloy controllers (and those of widgets) are BackBone event dispatchers so you should use ptr.on("release", fn).