bahar.wadia
Posts: 0
Joined: Wed Aug 07, 2013 2:05 am

How to link to a location on a page?

Is there a way to jump a specific location on a page.

For example, if I have a list of 100 items and only 4 or 5 items show up ion the screen (screen size limitations) can I provide an Anchor similar to HTML so that the user jump to item number 50 (or whatever).

Thanks for your help.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How to link to a location on a page?

Hi Bahar,

There are two ways to do this:
1) Add Link component with relative path to listitem.
2) Dynamically create inner URLs using append function.

bahar.wadia
Posts: 0
Joined: Wed Aug 07, 2013 2:05 am

How to link to a location on a page?

I understand what you are saying, but have no idea how to do either. Can you please provide me with an example. Thx

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How to link to a location on a page?

http://appery.io/app/view/3aba3058-a6...=

Hi Bahar.

Please try this solution:

1 In link from "array" to "listItem" click "AddJS/EditJS" and fill it with following code: http://prntscr.com/3iqrrz/direct

pre
code

jQuery(element).addClass("yourListItem_id" + value.id);

/code
/pre

2 Create JS event handler for "success" event on your list service with following code:

pre
code

var listItemId = /yourListItem=([\?\#]+)/gi.exec(window.location.search)[1];

var activeItem = jQuery(".yourListItem_id_" + listItemId)

if(activeItem[0])
activeItem[0].scrollIntoView();

/code
/pre

That's all.

From this time you can use links like:

http://appery.io/app/view/3aba3058-a6...

where: "534c7e16e4b02ae4f9496fc1" - is id of your list item. Got from "_id" collection attribute.

Regards.

Return to “Issues”