OData + WJFlexGrid post/put

Posted by: chifret on 14 September 2017, 12:11 pm EST

  • Posted 14 September 2017, 12:11 pm EST

    Hi,

    I’m using ODataCollectionView to build a grid, which is meant to be the main encoding tool of an app.

    As I discovered that the grid would automatically make every push/put/delete as needed, I felt very enthusiastic. Yet I’m blocked with it.

    Let’s say, I’ve an ID field and a last modification date. ID is auto-inc and date is like “on update current_timestamp”, so they’re managed server-side. The column is then empty with a isReadOnly.

    When I perform a post, the grid sends the ID and the last modification date with the request. Logical, it does know nothing about indexes and that stuff. But the server throws the request away because the ID is defined (0 - that can’t be) and the date too (0001-01-01) but not being legit (1971-01-01+).

    I don’t really figure out how and where the data is worked before reaching the api, and neither I find how to configure data binding from the grid to the request, or ways to catch/handle data before it goes to the server.

    Thanks in advance for your help !

  • Posted 14 September 2017, 12:11 pm EST

    Hello,

    The post method is called when a new row gets added into FlexGrid. For your reference, please refer to the attached sample that depicts the same.

    Please refer to Controllers folder for getting to know how a record can be added with an auto increment key.

    Thanks,

    Manish Kumar Gupta

    2017/08/OData.zip

  • Posted 14 September 2017, 12:11 pm EST

    Yes, I know. But it will post/put every fields of my object through OData.

    What I would like, is to prevent it to send ID (in case of post) and last modification date (for but post and put), for example.

    Is there any way to get that ?

    the event rowEditEnding sounds promising enough, but I won’t be able to remove a field from my object data definition, right ?

    And if so, how to know if I’m in the case of a get or a push ?

    Is there any samples that could help ?

    Thanks a lot.

  • Posted 14 September 2017, 12:11 pm EST

    Hi,

    We are looking into it. We shall get back to you on this soon.

    Thanks,

    Abhishek

  • Posted 14 September 2017, 12:11 pm EST

    Hello,

    We are sorry for the delayed response.

    This issue requires further investigation. Hence, this issue has been escalated to the concerned team for further investigation with tracking id 278256. We will let you know as soon as we get any update on this issue.

    Thanks,

    Manish Kumar Gupta

  • Posted 26 January 2018, 1:09 am EST

    HI,

    The ODataCollectionView class has a “fields” property that allows you to specify which fields in the database should be retrieved/used:

    http://wijmo.com/5/docs/topic/wijmo.odata.ODataCollectionView.Class.html#fields

    I hope this is what you wants…

    ~Manish

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels