Highlighted

Buttons that will sort data in table when clicked

Avatar

Avatar

teresag127

Avatar

teresag127

teresag127

24-07-2015

How can I make a form with a table that has buttons at the top to sort the user entered data? I want it to look like this: Like this: http://blogs.adobe.com/formfeed/files/formfeed/Samples/SalesReport.pdf

Replies

Highlighted

Avatar

Avatar

Magus069

MVP

Total Posts

1.0K

Likes

132

Correct Answer

150

Avatar

Magus069

MVP

Total Posts

1.0K

Likes

132

Correct Answer

150
Magus069
MVP

27-07-2015

Hi there,

why aren't you using the functionality created in the form you provided?

Highlighted

Avatar

Avatar

teresag127

Avatar

teresag127

teresag127

27-07-2015

I can't figure out how!!

Highlighted

Avatar

Avatar

Magus069

MVP

Total Posts

1.0K

Likes

132

Correct Answer

150

Avatar

Magus069

MVP

Total Posts

1.0K

Likes

132

Correct Answer

150
Magus069
MVP

27-07-2015

The function seems very easy to use, but you gotta make sure that each of your values for your forms are correct...

1. Make sure you have the Script Objects names well written...

2. When calling the function sort(); the first value is the button itself which is "this", that never changes

3. the 2nd value is the instance manager of the row of your table

3. The 3rd value of the function is the name of the field that is in the column of the button clicked, so when calling the function sort, it will look for each instances of that object you specified to sort the rows...

You don't need to change any more code for the sorting, just make sure your values are well written and everything should be fine..

If it is still not working, have a look at the JavaScript Debugger pressing Ctrl + J and look at your error!

Hope this help!

Highlighted

Avatar

Avatar

teresag127

Avatar

teresag127

teresag127

27-07-2015

Thanks for breaking it down for me.  I have my headings (buttons) in a master page subform.  Is that correct?

Highlighted

Avatar

Avatar

Magus069

MVP

Total Posts

1.0K

Likes

132

Correct Answer

150

Avatar

Magus069

MVP

Total Posts

1.0K

Likes

132

Correct Answer

150
Magus069
MVP

27-07-2015

That could cause errors, do you have a specific reason to put them in the master page??

Interacting with objects from master page to pages or pages to master pages may be very difficult...

I suggest you to have your whole table in a Page and not a master page..

Highlighted

Avatar

Avatar

teresag127

Avatar

teresag127

teresag127

27-07-2015

Thank you so much for your help! I feel like I am close, but not quite

there. This is what I have in the ScriptEditor: functionsort(this,Row1,

TextField1) and I have verified that "this" is my button, and the row and

text field are called the correct names, but it still won't work. I put it

all on the same page, too. It shows no errors in the javascript.

Thank you!

Highlighted

Avatar

Avatar

Magus069

MVP

Total Posts

1.0K

Likes

132

Correct Answer

150

Avatar

Magus069

MVP

Total Posts

1.0K

Likes

132

Correct Answer

150
Magus069
MVP

27-07-2015

you should be calling the function this way :

_Row1 is equivalent to Row1.instanceManager, which is the object that the function is expecting to receive.

The 3rd value is expecting to receive a name, so a string is the expected value...

By sending TextField1 without quotes, you send the whole object of TextField1 but it only wants to receive the name of the field, so "TextField1" is more likely what you have to send in parameter!

Highlighted

Avatar

Avatar

teresag127

Avatar

teresag127

teresag127

27-07-2015

Still no go. Is there a way I can send you my form?

Highlighted

Avatar

Avatar

teresag127

Avatar

teresag127

teresag127

27-07-2015

Do I put that script in the ScriptEditor of each button? or in the subform?

I've tried both ways with no luck, so far.