When I click in a row of table 1, I filter al register in table 2 by specific field. I already did it with java script.
So what I want to achive is: when press edit or new entry in table 2 , this table open a form right? to fill out this ok. One of those field that I have to fill out is combobox type (or select ). I want, by java script , choose automatically a register in this combo, In fact, the register would by the register of selected row in the table 1.
As a resume I just need to know how to set a value in the select (combobox) filed (in the new entry o edit form) by java script.
I usually set a value in a html select control with one of these lines of codes :
If the option "Number of possible values to load" is not set to ALL, but to any other specific number, this select box will be dynamically filled with data from the table after a user clicks on it from the database.
If it's set to ALL, the values in the select box will all be rendered. We're using the bootstrap select in wpDataTables, so after each modification of data for an option, you need to do a refresh.
Hi.
Im trying to achieve this:
In a new entry form, I have some fields to fill out. One of this is a dropdow field (is a select). So I want to fill out this field throughout jQuery.
I try as usually did in the past like.
jQuery('#table_12_ID_P').val(2);
jQuery('#table_12_ID_P option[value=2]').attr('selected','selected');
jQuery('#table_12_ID_P option[value="126"]').prop('selected',true);
But none of those worked.
Could you help me to figure it out?
Regards
Alejandro
Hello Alejandro.
I'm not sure what you need this for, but Select-box filter and select-box editor takes values from the table.
If you need predefined values for filters or editing, you can configure those in column settings.
Please explain in a bit more detail what you need this for.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Let me explain me better.
I have two table in my page.
When I click in a row of table 1, I filter al register in table 2 by specific field. I already did it with java script.
So what I want to achive is: when press edit or new entry in table 2 , this table open a form right? to fill out this ok. One of those field that I have to fill out is combobox type (or select ). I want, by java script , choose automatically a register in this combo, In fact, the register would by the register of selected row in the table 1.
As a resume I just need to know how to set a value in the select (combobox) filed (in the new entry o edit form) by java script.
I usually set a value in a html select control with one of these lines of codes :
jQuery('#table_12_ID_P').val(2);
jQuery('#table_12_ID_P option[value=2]').attr('selected','selected');
jQuery('#table_12_ID_P option[value="126"]').prop('selected',true);
But those does not work in the wdt combo, why?
Alejandro
Hi again Alejandro
If the option "Number of possible values to load" is not set to ALL, but to any other specific number, this select box will be dynamically filled with data from the table after a user clicks on it from the database.
If it's set to ALL, the values in the select box will all be rendered. We're using the bootstrap select in wpDataTables, so after each modification of data for an option, you need to do a refresh.
https://stackoverflow.com/questions/14804253/how-to-set-selected-value-on-select-using-selectpicker-plugin-from-bootstrap
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi Aleksandar
Nice. Its works for me.
Regards.
I'm glad to hear that, Alejandro
If you have any further questions or issues, please feel free to open a new ticket, and we'll gladly help.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables