none
Delete single row from a table binding RRS feed

  • Question

  • I am developing an app for office and is there a single way I can delete only a single row from a table binding? or do i have to store the table and then deleteallvalues and reload the remaining data?

    thanks

    Thursday, July 31, 2014 8:37 AM

Answers

  • Hi,

    >>or do i have to store the table and then deleteallvalues and reload the remaining data?<<

    Yes. I think we can only delete all the rows of data from a table binding. So you need to store the table, delete all values in the binding table, and rebind the data as you want.

    Here is a sample to delete all values from a binding table.

    function deleteAllRowsFromTable() {
            Office.context.document.bindings.getByIdAsync("GF-HeaderBinding", function (asyncResult) {
                var binding = asyncResult.value;
                binding.deleteAllDataValuesAsync();
            });
        }


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, August 1, 2014 10:05 AM
    Moderator
  • Hi,

    I’m afraid there is no method in TableBinding object to support deleting a single row currently. I suggest you to submit a Feedback to Office Development User Voice to have this feature in future.

    Sorry for the inconvenience.

    Regards,

    Jeffrey


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, August 4, 2014 2:07 AM
    Moderator

All replies

  • Hi,

    >>or do i have to store the table and then deleteallvalues and reload the remaining data?<<

    Yes. I think we can only delete all the rows of data from a table binding. So you need to store the table, delete all values in the binding table, and rebind the data as you want.

    Here is a sample to delete all values from a binding table.

    function deleteAllRowsFromTable() {
            Office.context.document.bindings.getByIdAsync("GF-HeaderBinding", function (asyncResult) {
                var binding = asyncResult.value;
                binding.deleteAllDataValuesAsync();
            });
        }


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, August 1, 2014 10:05 AM
    Moderator
  • Hi,

    I’m afraid there is no method in TableBinding object to support deleting a single row currently. I suggest you to submit a Feedback to Office Development User Voice to have this feature in future.

    Sorry for the inconvenience.

    Regards,

    Jeffrey


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, August 4, 2014 2:07 AM
    Moderator