JQGrid Radio Button Posting true false value to server instead of html tag - radio-button

I have created jqgrid with four columns and first column is radio button, created using formatter. I am passing the grid values to server on click of a save button. But it is posting the html tag as value for radio button column which is inside the formatter (used for creating the radio button) to server. Instead i want to post true (if radio is selected) or false to server. Please let me know how to do this.

Solved by using the unformat function

Related

Submit form from the outside of form using htmx

How to submit a form using submit button or input type submit outside of the form? In HTML It can be done easily using form ID but I didn't find the way to submit the form outside of the form in HTMX?
Can anybody help in this regard?
A couple of ways:
Dispatch a submit event to the form using javascript when the button is clicked.
Add the hx-post attribute on the external button and also add hx-include="#your-form-id". This will include all the inputs within the form in the request.

Radio buttons used in a rad grid in batch edit mode

I am trying to find any information about using a radio button in a rad grid in batch edit mode. I have created a template column, then added the radio button control, but it doesn't work in batch edit mode (nothing saves back to the DB). Is it even possible? I can't find anything on the Telerik site so I am suspecting its not supported. Thanks.
The Radio list is not supported in the batch editing mode. Such integration simply has not been implemented. The closest available option at this time is using a dropdown list: http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/batch-editing/defaultcs.aspx. Generally speaking, the standard way of editing boolean fields is through a checkbox column and not a radio button list - check the Discontinued checkboxes column.
What the grid does is that it loops through the controls with JS code when cells are opened and closed and determines control types and the proper API to use (e.g., $get().control.get_value() for dropdownlists, or $get().value for standard inputs). You can try implementing similar logic in the batch editing events.
You can try to use a RadRadioButtonList with the two items declared in its markup and its client-side API (see the get_selectedIndex() and set_selectedIndex() method: https://docs.telerik.com/devtools/aspnet-ajax/controls/radiobuttonlist/client-side-programming/radiobuttonlist-object) together with the following approach of working with templates: https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/data-editing/edit-mode/batch-editing/working-with-templates.
The idea is to have the radio button list in the edit template of the column and to select the correct item in it according to the newly opened cell value on the client, then fetch the selected item from the button list and put it in the grid data source.
You can find one example that you can try using as base in the following thread: https://www.telerik.com/forums/radiobuttonlist-in-gridtemplatecolumn.
Showing a radio button list in the item template is also something that is not supported, as the editing would basically happen in the "display" mode of the cell, and not in the edit mode of the cell. You could try using the server ItemDataBound event and FindControl() (see here: https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows#accessing-controls-in-template-column) may let you set initial values based on the data source for the radio button lists without data binding them. Then, perhaps a hidden field or hidden checkbox can be used for the actual data binding (see the template article above). You could also try using the batch editing manager changeCellValue() method on the client-side events of the radio button list, in a fashion similar to this article: https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/data-editing/edit-mode/batch-editing/how-to/editing-checkboxes.
Another approach you can consider is to use the client-side events of the radio button list and immediately upon change to call a service that will update the database. This may simplify the template handling logic (you could do this in a read-only column) but it goes against the purpose of batch editing to invoke one request with a lot of data, and you would also need to secure the service.
Another online resource to check is
https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/data-editing/edit-mode/batch-editing/how-to/editing-checkboxes

Ignore invisible field validation during form data submit

I have a form panel having fields like textfield and radio buttons.There are some conditions to hide textfield as per the radio button value.
have added custom validation to textfield.Suppose i have enter a invalid value to a text filed, then i clicked the radio button. as per my condition that invalid text field is now invisible.
Except that invisible field all other fields are valid. Now i want to submit the form data.
Is it possible to ignore the invisible field while submitting the form panel data.?
Thanks
Set the field not only to hidden as also to disabled, that will solve this. Or as mentioned in the comment if you just use a custom validation return true.

Extjs 4 grid customization after clicking on a row add a panel with a textfield

I am new to extjs 4 and I have got a problem to customize the grid panel. My application have JSON data to render in a grid. After populate the data when user click on a particular row he need to get an panel (Just like row editing plugin) of a textfield and a button to send the entered text to server through the controller. This data that user entered is not the data of grid column.
I need to know is it possible? And if it is, then how can I make it.
Thanks in advance.
Sure it is possible. First look at the following example from the Extjs 4.1 docs
All you need is to add your listener to itemclick grid event. Within this listener function you can create panel you need.

How can I make a Wicket form save radio button state?

I want to have a repeater like DataView or ListView. The first column of each row (named User ID) should be read from a List, and for each user ID, the program should dynamically create three radio buttons like these:
Requirements:
The user must able to change selection of radio buttons.
When the user clicks the submit button, radio values be displayed using the info("") method.
I've already done this by using this example, but when I click the submit button, old selections are shown, and the form gets reset to those old selections.
This example code might be helpful.
ListView doesn't play very well with form components, but it may work if you call ListView.setReuseItems(true);.