I have a drop-down in j-table and I want to extract the selected value from it. Is there any way to get the selected option values from j-table.
sections_template_id: {
title: 'Template',
inputTitle: "Template*",
options: web_sections,
create: true,
edit: true,
list: true
}
, sec_hidden: {
type: 'hidden'
, inputTitle: "Template*"
, create: true
, edit: false
, list: false
, defaultValue: web_sections
}
i want to set the value of sections_template_id in sec_hidden
this is my route on which i am calling a function
Route::post('cms-web-section-templates',['as' => 'cms-web-section-templates', 'uses' => 'CmsController@Main_sections']);
and here is my function
public function Main_sections(Request $request)
{
$types = SectionType::getTypes();
$web_section = WebTemplate::all();
//dd($web_section);
$rows[] = array("DisplayText"=>"", "Value"=>"");
foreach ($web_section as $key => $web_sections) {
$rows[] = array(
'DisplayText' => $web_sections->name,
'Value' => $web_sections->id,
);
}
$this->response['Options'] = $rows;
$this->response['Result'] = "OK";
return json_encode($this->response);
}
I used jquery/javascript to grab data from
jtable. I cant find in the jtable documentation how to grab the selected value. If you inspect element, once you select the row, a class is added in that row which is "jtable-row-selected".