Hello sir,
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 :
<script type="text/javascript">
function auto_fill_search(clicked_id)
{
if(clicked_id == "button1")
{
document.getElementById('gs_name').value = '<?php echo $dynamicvariable; ?>';
}
}
</script>
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.
Thanks
The culprit from FAQ:
<script>
function do_onload(id)
{
$("#gs_name").attr("placeholder","Search Name …").
}
</script>
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?