你能实现一个按钮,在选择完成后按下按钮发送数据吗?
@jthi
我就是这样开始的,但我不喜欢它,因为它很笨重而且打断了流程。
我真正想要的是像 javascript 选择事件一样工作的东西。
在图表上拖动一个选择框,然后将您选择的行收集到 JSON 中,并将它们发送到 html/javascript 土地中的本地主机服务器拖车
我使用调度程序来堆积不需要的事件的无用垃圾邮件,不断清除队列以防止触发大量垃圾邮件事件。
我以前尝试过使用 mousebox 的东西,包括完全重写选择机制,但它很慢并且有太多自身的缺点:
https://community.jmp.com/t5/Discussions/Is-there-a-way-to-make-the-rowstate-handler-less-laggy/mp/550590
// This is the row state handler
f = Function({x},
try(s << Clear Schedule);
//wait(2);
if(Is Empty(last_array),last_array = -1);
current_array = summary_jmp_table << 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) >0) & (sum(current_array) != sum(last_array)) & (global_iframe_counter>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 << Send;
//show(data);
//wait(0);
try(s << Stop);
try(s << 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 << Send;
), // end schedule
//show("didn't meet IF condition somehow");
); // end if
);// end function f