Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
260
Show/Hide columns of igGrid on igCombo Selection Changed
posted

Hi,

I need to show/hide some columns of my igGrid based on the selection of igCombo. I can only commit the rows when the user posts the form. I do my own manual commit & I am not using 'saveChanges' metod of igGrid because of various reasons. The problem I am facing is that the grid may have pending transactions in it and I dont want to lose them while hiding/showing the columns on dropdown selection changed event. When I hide a column through igGrid's hideColumn method the grid logs an error that commit the rows in the grid before doing this. But if I commit these rows, I wont get them in igTransactions later on when the form is posted. I dont want to lose the transactions & I also dont want to commit the rows before hiding/showing columns because the user might edit the existing transactions before submitting the form. Auto commit is set to false for a reason and I cannot set it to true because it will mess up some other things.

Is there a way to persist the transactions before hiding/showing columns of the grid without commiting them. Or if commiting is the only options, would I still get them in 'igTransactions' ?  If you could provide a short sample in which we can show/hide columns of a grid on any event WITH uncommitted data rows still in the grid, that would save me alot of time.  

Thanks for your time.

Parents
No Data
Reply
  • 17590
    Offline posted

    Hello Jimmy Page,

    Thank you for posting in our community.

    Currently it is not possible to hide columns before committing pending transactions. However, what I can suggest is using the allTransactions method from the igGrid API. It returns a list of all transaction objects that are either pending, or have been committed in the data source. For instance:

    [code]

    var transactions = $(".selector").igGrid("allTransactions");

    [/code]

    This way you are going to have access to all the transactions and no transactions are going to be lost.

    Please keep in mind that transactions are not going to be aggregated, which basically means that every time a new editing action is performed in the grid will be a separate transaction.

    Additionally, all the transactions are in a particular order, last transaction Is the most recent, respectively if you process them on the server in the same order the correct result should be retrieved.

    I hope you find this information helpful.

    Please let me know if you need any further assistance with this matter.

Children