# extJS führt update statt create aus

**URL:** <https://forum.shopware.com/t/extjs-fuhrt-update-statt-create-aus/12969>\
**Category:** Shopware 3.5\
**Tags:** programming\
**Created:** [30. April 2013 um 19:07 UTC](https://forum.shopware.com/t/extjs-fuhrt-update-statt-create-aus/12969 "2013-04-30T19:07:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pino](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/pino/32/14373_2.png) [@pino](https://forum.shopware.com/u/pino)\
**Post date:** [30. April 2013 um 19:07 UTC](https://forum.shopware.com/t/extjs-fuhrt-update-statt-create-aus/12969/1 "2013-04-30T19:07:44Z")

</div>

hallo zusammen, ich hab das schon 100mal gemacht, aber jetzt spinnt extJS. ich hab ein button das ein event feuert. im contoller fang ich das event ab. es soll ein neuen Eintrag in ein grid.Panel erstellt werden. ` ... me.control({ 'myPlugin-view-list': { 'createArticle': me.createArticle, 'deleteArticle': me.deleteArticle, 'edit': me.editArticle } }); ... var newCategory = me.getModel('List').create({ id: me.catID }); newCategory.save(); ... ` das model: ` Ext.define('Shopware.apps.myPlugin.model.List', { extend:'Ext.data.Model', idProperty:'id', proxy: { type: 'ajax', actionMethods: [{ create: 'POST', read: 'POST', update: 'POST', destroy: 'POST'}], api: { read: '{url controller=myPlugin action=readList}', create: '{url controller=myPlugin action=createList}', update: '{url controller=myPlugin action=updateList}', destroy: '{url controller=myPlugin action=deleteList}' }, reader: { type: 'json', root: 'data' } }, fields:[{ name: 'id', type:'int' }, { name: 'name', type:'string' }] }); ` warum auch immer. es wird immer “/backend/myPlugin/updateList” ausgeführt. ich hab auch schon andere bezeichnungen vergeben aber es wird nie ‘create’ ausgeführt. wo ist der wurm versteckt?

---

<div class="post-metadata">

**Author:** ![Oliver\_Skroblin](https://avatars.discourse-cdn.com/v4/letter/o/6bbea6/32.png) [@Oliver\_Skroblin](https://forum.shopware.com/u/Oliver_Skroblin)\
**Post date:** [30. April 2013 um 19:57 UTC](https://forum.shopware.com/t/extjs-fuhrt-update-statt-create-aus/12969/2 "2013-04-30T19:57:13Z")

</div>

Hi, sobald ein ExtJS Model eine ID zugewiesen bekommen hat, wird statt der create Url die update Url benutzt. Speicher einfach die catID in ein anderes Feld statt in das ID Feld. Gruß Oliver

---

<div class="post-metadata">

**Author:** ![pino](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/pino/32/14373_2.png) [@pino](https://forum.shopware.com/u/pino)\
**Post date:** [3. Mai 2013 um 18:13 UTC](https://forum.shopware.com/t/extjs-fuhrt-update-statt-create-aus/12969/3 "2013-05-03T18:13:08Z")

</div>

genau das war’s. ich hab nun statt id eine andere bezeichnung genommen, und schon klappt’s, danke. :thumbup:
