0
我正在尋找一種解決方案,將數據字段之一作爲sencha模型中的唯一字段,但我無法找到它的文檔。這裏是代碼模型中的唯一字段
Ext.define('handfree.model.CategoryM', {
extend: 'Ext.data.Model',
requires: [
'Ext.data.identifier.Uuid'
],
config: {
fields: [
{ name: 'id', type: 'int' },
{ name: 'name', type: 'string' }
],
idProperty: 'id',
identifier : 'uuid'
}
});
我需要'名稱'字段是唯一的。非常感謝你!
這是很好的建議,其實我是用循環方法過濾掉重複的記錄在上述情況下的「名稱」字段,他們是同樣的理論,但你的好多了。模型中是否存在允許在某些領域避免重複記錄以實現「獨特」 – ryo 2012-08-16 16:00:17