I have 2 questions:
1. How can I set the placeholder for search field on a column ?
Declaration of the column with search:
$col = array();
$col["title"] = "Name";
$col["name"] = "name";
$col["fixed"] = false;
$col["width"] = "200px";
$col["editable"] = false;
$col["style"] = "font-size:2em";
$col["search"] = true;
$cols = $col;
2. Having this button button with some dynamic value that comes from php variable:
<button onclick='auto_fill_search(this.id)' id='button1' type='button' class='btn gsc-btn-nobg'>" . $dynamicvariable . "</button>
I did come up with this function :
if(clicked_id == "button1")
document.getElementById('gs_name').value = '<?php echo $dynamicvariable; ?>';
But it don't autofill the search input field on column name.
Is there any way to populate search field from a click on a button (or <a href>?
Many thanks !
There might be a typo on your Faq about (id) and (ids) since the tip don't work also.
The culprit from FAQ:
$("#gs_name").attr("placeholder","Search Name …").
See that point at the end of the $ line ? Put ";"
For case2, please view source page and see if this dynamic value is present or not?
Your code seems correct.
If this variable is passed as POST from other page, you need session persistance.
faq: Q) How to load grid based on $_POST data from other page?
We are sorry that this post was not useful for you!
Let us improve this post!
Tell us how we can improve this post?