0

我在这个网格上的过滤器有问题:

网格声明:

            >$("#grid2").kendoGrid({
                dataSource: {
                    transport: {
                        read: "datos/CargarTipo_Impresion_s.php" //php file with mysql sentence
                    },
                    batch: true,
                    schema: {
                        model: 
                            id: "notipoimpresion",
                            fields: 
                                notipoimpresion: { type: "number" },
                                descripcion: { type: "string" },
                                nogrupo: { type: "number" },
                            }
                        }
                    },
                    //send notipoimpresion like parameter to the page : CargarTipo_Impresion_s.php
                    serverFiltering: true,
                    //filter: { field: "notipoimpresion", operator: "eq", value: "1,2" }, // with this filter is ok, show data
                    //filter: { field: "notipoimpresion", operator: "eq", value: 2 }, //with this filter is ok , show data
                    //filter: { field: "notipoimpresion", operator: "eq", value: '1,2' }, //with this filter is ok, show data

                    filter: { field: "notipoimpresion", operator: "eq", value: value_codigos_tipo_impresion }, //with this filter doesn´t show data
                    //value_codigos_tipo_impresion, can have this values: "1" or "1,2" or "1,2,4", etc.
                   //value_codigos_tipo_impresion, receive the value from a form text

在 CargarTipo_Impresion_s.php 中使用:

$codigos_tipo_impresion = mysql_real_escape_string($_REQUEST["filter"]["filters"][0]["value"]);

并执行一个mysql语句

在其他带有 php 变量的示例中!

过滤器:{字段:“notipoimpresion”,运算符:“eq”,值:“?php var_codigos_tipo_impresion;?” },

当 $var_codigos_tipo_impresion: 可以有值:“1”、“1,2”、“1,2,3·等...

谁能告诉我,为什么不做过滤器?或者有什么问题?

谢谢
JC

4

1 回答 1

0

示例和解决方案:代码更正和版本 KendoUI CSS 和 JavaScript:v2012.3.1114

jsfiddle.net/jcpaquot/vJTwF/6][1]

于 2013-02-13T11:03:35.120 回答