CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

SortbleList.OnStop Event

by dfields » 15 Jan 2015 12:01

How do you access the details of the AParam['ui'] in the OnStop event. This is what gets fired after the user has moved an item. I cannot seem to get enough detail to know what has been moved.
dfields
 
Posts: 130
Joined: 24 Jul 2013 20:14

by Jorge Sousa » 15 Jan 2015 12:05

Hi Daniel

You must debug in browser, with ServerController.JavascriptOptions = (true,true), put a breakpoint in OnStop and check what ui param you can use.

Then all you have to do is define OnStop.BrowserParam, choose a ServerName that you like, and set BrowserScript to a valid javascript expression.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by dfields » 15 Jan 2015 12:35

Hi Jorge,

I have never done any of the steps you outlined. I know enough about java script to be dangerous. Most of what I know has come from what I have had to pickup to use your tools.

I do not know how to set a breakpoint in the browser. I checked the plugin documention for the OnStop event. The ui object is supposed to have Item, Position and originalPosition properties. I believe that is what I need, but I am not certain. According to the documentation those appear to be coordinates rather than index or position values.

I am assuming that I would define those properties as OnStop.BrowserParameters. Is that correct?
dfields
 
Posts: 130
Joined: 24 Jul 2013 20:14

by Jorge Sousa » 15 Jan 2015 12:50

Hi Daniel

First, put ServerContrroller.JavaScriptOptions.Debug=True, you might want also to set ServerContrroller.JavaScriptOptions.UseUncompressedFiles=True, but this is not important for this.

When you set ServerContrroller.JavaScriptOptions.Debug=True, the javascript generated is more readable.

Run your application. Inthe browser, hit F12, this will lead you to the development tools.

Check Scripts, the main script, and find the OnStop part. Put a breakpoint there.

But if you want you can send us a test case of what you're doing, or gop to skype id cgdevtools, we make a fast remote session to tell you how its done quicker than type :)
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by Alexander Bulei » 15 Jan 2015 12:53

Hi Daniel,

I am assuming that I would define those properties as OnStop.BrowserParameters. Is that correct?


Yes, you need create BrowserParameter for each javascript object property.

Small video attached, how to debug in FireFox with Firebug.

Best Regards.
You do not have the required permissions to view the files attached to this post.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by dfields » 20 Jan 2015 20:27

I am just now getting back to this issue. I was able to follow the attached video to get into the debugger in FF. I was able to set a breakpoint in the OnStop event and inspect the parameters that where available at that point.

There is nothing that provides any information I can use to respond to the new order of items. I could find nothing that told me which item was moved and to which position. All of the properties related to items provide UI coordinates, but not an index or caption. Can you point me to the correct properties?

I even tried examining the list items after moving one of the items. Nothing changes. The items remain in the exact order in which they were added to the list.

Is there a working example that shows how to obtain the new list order, or that shows how to code the OnStop event? Am I missing something obvious? Am I using this component for the wrong purpose?

How do you get the re-ordered list items?
You do not have the required permissions to view the files attached to this post.
dfields
 
Posts: 130
Joined: 24 Jul 2013 20:14

by Alexander Bulei » 21 Jan 2015 10:27

Hi Daniel,

Indeed, the ui parameter does not have the information about the item index.
Therefore, we will implement additional parameters for such.

Update:

Implemented for next build:

- Added: Internal parameters "originalIndex" & "newIndex" to OnStop event
- Added: Internal parameter "originalIndex" to OnStart event


Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by dfields » 21 Jan 2015 11:26

Beautiful. Thank you!
dfields
 
Posts: 130
Joined: 24 Jul 2013 20:14


Return to General

Who is online

Users browsing this forum: No registered users and 69 guests

Contact Us.