<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Workarounds for the dreaded Row State Handler in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Workarounds-for-the-dreaded-Row-State-Handler/m-p/638888#M83666</link>
    <description>&lt;P&gt;Drag a selection box on the graph, then gather your selected rows up into JSON and fire them off to a localhost server tow ork in html/javascript land&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use the scheduler to pile in the useless spam of unwanted events constantly clearing the queue to prevent the slew of spam events from firing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried using mousebox stuff before, including totally rewriting the selection mechanic, but it was laggy and had too many of its own drawbacks:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.jmp.com/t5/Discussions/Is-there-a-way-to-make-the-rowstate-handler-less-laggy/m-p/550590" target="_blank"&gt;https://community.jmp.com/t5/Discussions/Is-there-a-way-to-make-the-rowstate-handler-less-laggy/m-p/550590&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// This is the row state handler
f = Function({x},
	try(s &amp;lt;&amp;lt; Clear Schedule);
	//wait(2);
	if(Is Empty(last_array),last_array = -1);
	current_array = summary_jmp_table &amp;lt;&amp;lt; get selected rows();
	/**/
	// These "If" conditions stop it from needlessly spamming events out to the server that's going to draw an interactive app
	// Can't just compare 2 arrays to see if they are exactly the same. It tries to compare every number in the 2 arrays by index position, so the SUM of that is used to tell if they are different.
	if((length(current_array) &amp;gt;0) &amp;amp; (sum(current_array) != sum(last_array)) &amp;amp; (global_iframe_counter&amp;gt;0) ,
		//show("we have a go");
		s = Schedule(.225,		
			//json = As JSON Expr(current_array);
			json = sel_rows_2_JSON(); //a function that gets selected rows and bundles them up into JSON to send my data request
			request = New HTTP Request(
				URL("localhost:8088/jmp_data"),
				Method("Post"),
				Timeout( .001 ),
				JSON(json),
			);
		//data=request &amp;lt;&amp;lt; Send;
		//show(data);
		//wait(0);
		try(s &amp;lt;&amp;lt; Stop);
		try(s &amp;lt;&amp;lt; Clear Schedule);
		//wait(0);	
		last_array = current_array;
		// saves the last array, this stops it from spamming out events for no reason when you hover over points on a graph. 
		//I don't know WHY hover fires a row state event, but it does.	 
		data=request &amp;lt;&amp;lt; Send;			
		), // end schedule
		//show("didn't meet IF condition somehow");
	); // end if
);// end function f&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 16:11:22 GMT</pubDate>
    <dc:creator>xxvvcczz</dc:creator>
    <dc:date>2023-06-09T16:11:22Z</dc:date>
    <item>
      <title>Workarounds for the dreaded Row State Handler</title>
      <link>https://community.jmp.com/t5/Discussions/Workarounds-for-the-dreaded-Row-State-Handler/m-p/638888#M83666</link>
      <description>&lt;P&gt;Drag a selection box on the graph, then gather your selected rows up into JSON and fire them off to a localhost server tow ork in html/javascript land&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use the scheduler to pile in the useless spam of unwanted events constantly clearing the queue to prevent the slew of spam events from firing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried using mousebox stuff before, including totally rewriting the selection mechanic, but it was laggy and had too many of its own drawbacks:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.jmp.com/t5/Discussions/Is-there-a-way-to-make-the-rowstate-handler-less-laggy/m-p/550590" target="_blank"&gt;https://community.jmp.com/t5/Discussions/Is-there-a-way-to-make-the-rowstate-handler-less-laggy/m-p/550590&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// This is the row state handler
f = Function({x},
	try(s &amp;lt;&amp;lt; Clear Schedule);
	//wait(2);
	if(Is Empty(last_array),last_array = -1);
	current_array = summary_jmp_table &amp;lt;&amp;lt; get selected rows();
	/**/
	// These "If" conditions stop it from needlessly spamming events out to the server that's going to draw an interactive app
	// Can't just compare 2 arrays to see if they are exactly the same. It tries to compare every number in the 2 arrays by index position, so the SUM of that is used to tell if they are different.
	if((length(current_array) &amp;gt;0) &amp;amp; (sum(current_array) != sum(last_array)) &amp;amp; (global_iframe_counter&amp;gt;0) ,
		//show("we have a go");
		s = Schedule(.225,		
			//json = As JSON Expr(current_array);
			json = sel_rows_2_JSON(); //a function that gets selected rows and bundles them up into JSON to send my data request
			request = New HTTP Request(
				URL("localhost:8088/jmp_data"),
				Method("Post"),
				Timeout( .001 ),
				JSON(json),
			);
		//data=request &amp;lt;&amp;lt; Send;
		//show(data);
		//wait(0);
		try(s &amp;lt;&amp;lt; Stop);
		try(s &amp;lt;&amp;lt; Clear Schedule);
		//wait(0);	
		last_array = current_array;
		// saves the last array, this stops it from spamming out events for no reason when you hover over points on a graph. 
		//I don't know WHY hover fires a row state event, but it does.	 
		data=request &amp;lt;&amp;lt; Send;			
		), // end schedule
		//show("didn't meet IF condition somehow");
	); // end if
);// end function f&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 16:11:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Workarounds-for-the-dreaded-Row-State-Handler/m-p/638888#M83666</guid>
      <dc:creator>xxvvcczz</dc:creator>
      <dc:date>2023-06-09T16:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: Workarounds for the dreaded Row State Handler</title>
      <link>https://community.jmp.com/t5/Discussions/Workarounds-for-the-dreaded-Row-State-Handler/m-p/638934#M83668</link>
      <description>&lt;P&gt;Could you implement a button which is pressed to send the data after the selection has been done?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 17:57:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Workarounds-for-the-dreaded-Row-State-Handler/m-p/638934#M83668</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-06-05T17:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: Workarounds for the dreaded Row State Handler</title>
      <link>https://community.jmp.com/t5/Discussions/Workarounds-for-the-dreaded-Row-State-Handler/m-p/638978#M83680</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's how I started, but I don't like it because it's clunky and breaks the flow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I really want is something that works like a javascript selection event.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 20:23:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Workarounds-for-the-dreaded-Row-State-Handler/m-p/638978#M83680</guid>
      <dc:creator>xxvvcczz</dc:creator>
      <dc:date>2023-06-05T20:23:50Z</dc:date>
    </item>
  </channel>
</rss>

