$.UIGoToArticle fires Uncaught TypeError: Cannot read property 'id' of undefined

29 views
Skip to first unread message

Trian Karayiannis

unread,
Nov 13, 2014, 1:19:22 PM11/13/14
to chocolat...@googlegroups.com
OK, so I have a search button of the sort...

<button onclick="_app.validateForm()">Search</button>

and then in javascript...

validateForm : function() {
 
// gather and validate inputs. If all is well...
  $
.UIGoToArticle('#search_results');
 
// show them the $.UIBusy stuff and fire the $.ajax request
}

According to the documentation [ http://www.chocolatechip-ui.com/documentation#/chuijs ], this should work without being invoked within some navigation list.

Yet, and I've tested this in multiple browsers and devices, every single time the $.UIGoToArticle line is executed, I get 

Uncaught TypeError: Cannot read property 'id' of undefined

Am I doing something wrong? I've searched in the documentation and I find no other way to go from my #search screen to the #search_results one.

Trian

PS. I am running version 3.8.0.

Trian Karayiannis

unread,
Nov 13, 2014, 1:34:16 PM11/13/14
to chocolat...@googlegroups.com
Plus, I've tested the "indicated" method of creating the button by itself:

<button id="btn_search">Search</button>

and later in javascript binding behaviour to it:

$('#btn_search').on('click singletap', function() {
 
// all the contents of validateForm() above
});

I did this hoping that your code somehow expects something to be set by $(this), which would have not been set by my previous efforts.

Again, the method invocation fails with the same exact error.

Trian 

Robert Biggs

unread,
Mar 6, 2015, 1:44:32 PM3/6/15
to chocolat...@googlegroups.com
First of all, sorry for the delay, this account had been heavy spammed and your email was buried with tons of spam. 
You code looks correct. However, because of the undefined being returned, it leads me to believe either the article of that id doesn't exist, or you have a typo in the id you've entered. You can see this same $.UIGoToArticle() method in action in the example: navigation-backto.html in your examples folders.

Perhaps you could provide me a zip or a link to see what the issue is.

--
You received this message because you are subscribed to the Google Groups "ChocolateChip-UI" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chocolatechip-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages