mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Catching GridField filter submission to enable usage through enter key in addition to clicking on the filter button (SSF-53)
This commit is contained in:
parent
c3f4db1d7d
commit
d02a68089f
@ -141,4 +141,18 @@
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Catch submission event in filter input fields, and submit the correct button
|
||||||
|
* rather than the whole form.
|
||||||
|
*/
|
||||||
|
$('.ss-gridfield .filter-header :input').entwine({
|
||||||
|
onkeydown: function(e) {
|
||||||
|
if(e.keyCode == '13') {
|
||||||
|
btn = this.closest('.filter-header').find('.ss-gridfield-button-filter');
|
||||||
|
this.getGridField().reload({data: [{name: btn.attr('name'), value: btn.val()}]});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}(jQuery));
|
}(jQuery));
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<% control Fields %>
|
<% control Fields %>
|
||||||
<th class="extra"><span>$Field</span></th>
|
<th class="extra filter-header"><span>$Field</span></th>
|
||||||
<% end_control %>
|
<% end_control %>
|
||||||
</tr>
|
</tr>
|
Loading…
Reference in New Issue
Block a user