Sencha touch 2 在Sencha Touch 2中选择针对WebSQL的参数查询?
我可以在SenchaTouch2中使用SQL代理针对WebSQL数据库编写一个带有参数的简单select查询吗 例如,我很乐意提交查询以请求特定月份的数据:Sencha touch 2 在Sencha Touch 2中选择针对WebSQL的参数查询?,sencha-touch-2,Sencha Touch 2,我可以在SenchaTouch2中使用SQL代理针对WebSQL数据库编写一个带有参数的简单select查询吗 例如,我很乐意提交查询以请求特定月份的数据: SELECT * FROM Expenses WHERE strftime('%m', SubmitDate) = '04' 好的,在深入研究Sencha Touch SQL proxy的源代码之后,解决方案最终使用了存储过滤器,例如: Ext.define('Rich.Lite.Web.store.Expenses', { ex
SELECT * FROM Expenses WHERE strftime('%m', SubmitDate) = '04'
好的,在深入研究Sencha Touch SQL proxy的源代码之后,解决方案最终使用了存储过滤器,例如:
Ext.define('Rich.Lite.Web.store.Expenses', {
extend: 'Ext.data.Store',
requires: 'Rich.Lite.Web.model.Expense',
config: {
model: 'Rich.Lite.Web.model.Expense',
proxy: {
type: "sql"
},
filters: [
{
property: "strftime('%m', date)",
value: "04"
}
]
}
});