Giter VIP home page Giter VIP logo

Comments (9)

FokkeZB avatar FokkeZB commented on June 18, 2024

Can you show me the XML and JS where you used it?

from nl.fokkezb.infinitescroll.

PierreGUI avatar PierreGUI commented on June 18, 2024

Let me try with the latest version of the widget before ... 🐤

from nl.fokkezb.infinitescroll.

PierreGUI avatar PierreGUI commented on June 18, 2024

Ok still crashing, hope this code will help you:
XML :
<TableView id="tableView">
<Widget id="is" src="nl.fokkezb.infiniteScroll" onEnd="loadMore" />
</TableView>

JS:

addManyToView = function(collection) {
var baseData, limitedVideos, newData;

baseData = $.tableView.data;
newData = [];
limitedVideos = Alloy.createCollection('Video', collection.first(_displayAmount));

limitedVideos.each(function(V) {
newData.push((Alloy.createWidget($.__widgetId, 'Row', {
video: V
})).getView());
});

$.tableView.data = baseData.concat(newData);
};

from nl.fokkezb.infinitescroll.

FokkeZB avatar FokkeZB commented on June 18, 2024

What Alloy version are you using? Does it work when using Alloy 1.4.1?

from nl.fokkezb.infinitescroll.

PierreGUI avatar PierreGUI commented on June 18, 2024

Currently using Alloy 1.5.0-rc3 with CLI version 3.4.0-rc4
Same with Alloy 1.4.1

here is the full error trace:

backtrace = "#0 init()
at file://.../wz_rc.app/alloy/widgets/nl.fokkezb.infiniteScroll/controllers/widget.js:31\n#1 Controller()
at file://.../wz_rc.app/alloy/widgets/nl.fokkezb.infiniteScroll/controllers/widget.js:145\n#2 ()
at file://.../wz_rc.app/alloy.js:227\n#3 ()
at file://.../wz_rc.app/app.js:50\n#4 Controller()
at file://.../wz_rc.app/alloy/widgets/wz.StreamTableView/controllers/widget.js:31\n#5 ()
at file://.../wz_rc.app/alloy.js:227\n#6 ()
at file://.../wz_rc.app/app.js:50\n#7 Controller()
at file://.../wz_rc.app/alloy/controllers/Stream.js:34\n#8 ()
at file://.../wz_rc.app/alloy.js:231\n#9 ()
at file://.../wz_rc.app/app.js:44\n#10 Controller()
at file://.../wz_rc.app/alloy/controllers/index.js:94\n#11 ()
at file://.../wz_rc.app/alloy.js:231\n#12 ()
at file://.../wz_rc.app/app.js:44";

line = 41;
message = "'undefined' is not an object (evaluating '__parentSymbol.sections[sectionIndex]')";
name = TypeError;
sourceURL = file://.../wz_rc.app/alloy/widgets/nl.fokkezb.infiniteScroll/controllers/widget.js";

from nl.fokkezb.infinitescroll.

FokkeZB avatar FokkeZB commented on June 18, 2024

I don't see a call to $.is.init() in your JS snippet, nor the method loadMore you have in the XML snippet. The line mentioned in the error trace should only be executed if the widget is used in a list view, but it might also execute if it isn't initialised properly.

from nl.fokkezb.infinitescroll.

PierreGUI avatar PierreGUI commented on June 18, 2024

I do call $.is.init($.tableView) within my widget's constructor now, but the crash happens before the controller's code.
Looking into file://.../alloy/widgets/wz.StreamTableView/controllers/widget.js:31, I found out:

$.__views.is = Alloy.createWidget("nl.fokkezb.infiniteScroll", "widget", {
id: "is",
__parentSymbol: __parentSymbol
});
loadMore ? $.__views.is.on("end", loadMore) : __defers["$.__views.is!end!loadMore"] = true;
$.__views.tableView = Ti.UI.createTableView({
separatorColor: "#dbdbdb",
scrollsToTop: true,
minRowHeight: 0,
rowHeight: 0,
footerView: $.__views.is.getProxyPropertyEx("footerView", {
recurse: true
}),
id: "tableView"
});

If titanium is trying to instantiate your widget before creating the tableView, that'd explain a lot... no ?

edit: after moving the call to $.is.init($.tableView), I realise this issue is not related to iOS8 and also happens on ios7.1 copiled with Ti 3.2.3. To be continued tomorrow...

from nl.fokkezb.infinitescroll.

FokkeZB avatar FokkeZB commented on June 18, 2024

Could you try https://github.com/FokkeZB/nl.fokkezb.infiniteScroll/blob/master/controllers/widget.js ?

Alloy 1.5.0 has some weird changes to __parentSymbol

If it is being used in a required controller e.g. then it may point to the parent controller instead of a view ;)

from nl.fokkezb.infinitescroll.

PierreGUI avatar PierreGUI commented on June 18, 2024

Awesome ! Works flawless
Thanks a lot Fokke 👍

from nl.fokkezb.infinitescroll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.