Skip to content

Commit 2297844

Browse files
committed
Grid SPF: Fix menugrid implementation to use columns-option (instead of reading data-attributes from markup).
1 parent 2470cdc commit 2297844

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

grid-spf/menugrid.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ $.widget("spf.menugrid", {
2525
});
2626

2727
inputs.find( "input" ).bind( "change", function() {
28-
var head = $( this ).parent(),
29-
field = head.data( "field" ),
30-
type = head.data( "type" ),
28+
var column = grid.options.columns[ this.parentNode.cellIndex ],
3129
value = this.value,
3230
operator;
3331

@@ -36,20 +34,20 @@ $.widget("spf.menugrid", {
3634
value = value.substring( operator.length );
3735
value = value == null || isNaN( value ) ? "" : value;
3836
}
39-
if ( type === "number" ) {
37+
if ( column.type === "number" ) {
4038
value = parseFloat( value );
4139
operator = operator || "==";
4240
}
43-
if ( type === "string" ) {
41+
if ( column.type === "string" ) {
4442
operator = "like";
4543
}
4644
if ( value ) {
47-
source.option( "filter." + field, {
45+
source.option( "filter." + column.property, {
4846
operator: operator,
4947
value: value
5048
});
5149
} else {
52-
source.option( "filter." + field, null );
50+
source.option( "filter." + column.property, null );
5351
}
5452
source.refresh();
5553
});

0 commit comments

Comments
 (0)