JQuery for Table Widget

JQuery for Table Widget

  
Good Day!

I saw the below JQuery that sets a row index for a particular grid by searching the ID value "1014" in the list. May I kindly ask if what is the equivalent syntax when using it for a Table Widget.

Thank you.

Regards,

Tupe

function selectRow() {
			jQuery('#jqGrid').jqGrid('setSelection','1014');
		}
Good Day!


Anyone can help me on this please.


Thank you.


Sincerely,

Tupe
Good Day!

Anyone can help me on this please.


Thank you.

Regards,

Tupe
Hi Christophe/Tupe,

I'm not sure I understand what you are trying to do. There is no visibly "selected" row in a Table Records. When the user clicks on a row, the data of that row is accesible by the Current of the Table Records list, but I can't see the functional need to set the Current programmatically.
Hi Killian,

I have a Table Widget with a Check Box and Input Widgets as shown in the attached file. As you can see, I have an Input Widget which I set the Valid value to False (with a red border) to inform the User he/she is required to input a value. Now, if the Check Box on the left most column has been selected, the Check Boxes on the right side should be unchecked and the input boxes should be set to Zero and disabled as well.

When I invoke an Ajax Refresh to the Table, the Check Marks on the right side of the table were sucessfully removed and the Input Widgets were disabled as well, but the valid indicator that was previously set to False on the left side Input Widget (1st row) was removed. Indicating that it was reset to true.

I saved the Current Record value of the Table and Element ID of the highlighted Input Widget to local variables prior to execution of the Ajax Refresh (1st row).  What I need is to set the border line to red again of the Input Widget of the said row.

Please bear with me on my logic, I'm still adjusting on this Agile Platform, specially on applying Javascripts.


Thank you and Best Regards.

Tupe

Hi Tupe,

In general, especially as a beginner, don't mess with JavaScript. Ajax Refreshes combined with an OnUpdate action are usually fine.

You say "the valid indicator (...) was removed, indicating it was reset to true", but what I think happens, is that the indicator is only shown when the input field is enabled. So when you disable the input, the validation is turned off.

I'm not sure why you save values to local variables. What are you trying to do with them?
Hi Kilian,

Thank for the reply. I saved the value since my objective is to set the valid indicator to false across different rows during runtime. But what I notice during runtime is that, if the user didn't click the Input Widget in the Table, it's Element ID is blank, and during For Each Loop, when the current row number changes, the Element ID of the following Input Widget is also blank. So even if I create a screen action that sets the valid value to false for the Input Widgets, it fails since no Element ID is found for a particular Input WIdget inside the table.