Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Re: How to correctly clear a Row State Handler

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Mar 9, 2016 10:07 AM
(8229 views)

I have a very simple Row State Handler that makes sure that a given selected row can never be unselected. The issue is, that I want to turn off that functionality and continue with normal operations.

Here is the simple script that locks down row 15 to always be selected.

names default to here**(1)**;

dt=open**(**"$SAMPLE_DATA\big class.jmp"**)**;

x=**15**;

dt << **select rows(**x**)**;

setrow = function**({**x**}**,dt<<**clearselect**

rs = dt << **Make Row State Handler(**setrow**(**x**))**;

So now the question is, how do I remove the Row State Handler, short of closing and reopening the data table? I can change the rowstate handler to a different function, but I would prefer to just remove the Row State Handler.

Does anyone have an answer?

Jim

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Probably not the correct solution but I assign an empty function to the row state handler:

empty_function = function({x},{z},

z = 1;

);

rs = dt << Make Row State Handler(empty_function);

Somehow it does not work if the function is completely empty, so I added z=1 as 'dummy code'.

Regards

Peter

PS: How can you format sample code as 'code' (like you did)? Seems like I am too dumb to understand the forum software.

5 REPLIES 5

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Probably not the correct solution but I assign an empty function to the row state handler:

empty_function = function({x},{z},

z = 1;

);

rs = dt << Make Row State Handler(empty_function);

Somehow it does not work if the function is completely empty, so I added z=1 as 'dummy code'.

Regards

Peter

PS: How can you format sample code as 'code' (like you did)? Seems like I am too dumb to understand the forum software.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: How to correctly clear a Row State Handler

I copy/paste JSL code to MS-Word, then copy/paste it from Word to here. For example:

empty_function = function**({**x**}**,**{**z**}**,

z = **1**;

**)**;

rs = dt << **Make Row State Handler(**empty_function**)**;

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: How to correctly clear a Row State Handler

Thanks.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: How to correctly clear a Row State Handler

The below seems to clear the row state handler (but not the current row states):

Clear Globals**(**rs**)**;

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: How to correctly clear a Row State Handler

An old question, but why not just setting rs=0 ?