DataFeed and defaultData

I have datatable and form binded together. I use dataFeed to get adittional data when updating. Now I want to set defaultData when I create new item.

Now dataFeed is called also for creating item because of defaultData (before it wasn0t). Is now correct way to check if it is ID and load additional data (from) and if not setValues to form?

Tagged:

Comments

  • edited July 2018

    Hello,

    Could you please share the snippet of your implementation?

    You can also use the data scheme instead of the defaultData, if it helps.

  • There is deeper problem. When you add new item. After save when you open adding form default data is not set. This is really strange way of working.

    I also notice if I select one item and than open adding form. It works as it should.

    I am really confused.

  • More data.

    Datatable and form are bind together. For adding I set unselectAll so I have empty form. On datatable I set defaultData. I get default data in form. I enter all other data and save form. Data is add to datatable and send to server. New item is not selected in datatable also cursor is set to null. But connection is still there. Because form is still populated with values. I fixed this with calling clear form. But this is not right way. Because now I have problem with defaultData. If I call setCursor(null) or unselectAll have no effect.

    Here is the real question. How do I "unselect" item after data insert?

  • edited September 2018

    Here is snippet:

    https://snippet.webix.com/cf20yx3o

    To get right behavior I now select new item in event "onAfterInsert" on DataProcessor.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!