Author Topic: There is not Delete-Row function in Context menu.  (Read 1695 times)

hyh888

  • Pro Enterprise
  • Full Member
  • *
  • Posts: 142
    • View Profile
There is not Delete-Row function in Context menu.
« on: October 13, 2021, 06:44:43 am »
There is not Delete-Row function in Context menu. For I navigrate to this page from https://paramquery.com/pro/demos/import-xlsx , the picture(pgGrid logo in the table) in the orginal page is still on the new page. I have draged the picture in the orginal page,maybe this action triggered the bug.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: There is not Delete-Row function in Context menu.
« Reply #1 on: October 13, 2021, 10:05:15 am »
context menu on rows in that example uses deleteRow API method and that's normal designed behaviour of that method not to delete any images.

There is a separate method for removing pictures which is invoked by using context menu on the image itself.

https://paramquery.com/pro/api#method-Pic

Code: [Select]
action: function (evt, ui) {         
    var Pic = this.Pic()
    Pic.remove( Pic.getId( ui.ele ) )
}

hyh888

  • Pro Enterprise
  • Full Member
  • *
  • Posts: 142
    • View Profile
Re: There is not Delete-Row function in Context menu.
« Reply #2 on: October 13, 2021, 10:55:51 am »
for there is not "delete row" or "delete rows" option in context menu, can this option be added in the context menu?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: There is not Delete-Row function in Context menu.
« Reply #3 on: October 13, 2021, 11:26:15 am »
Delete row option is already there in context menu.

Do you mean to include remove images/pictures functionality with delete rows?

hyh888

  • Pro Enterprise
  • Full Member
  • *
  • Posts: 142
    • View Profile
Re: There is not Delete-Row function in Context menu.
« Reply #4 on: October 14, 2021, 08:02:26 am »
I recheck the sample in https://paramquery.com/pro/demos, but in the Context Menu there is no "Delete Row" option.  For there is no way to upload screen-cut in the post, I couldn't show you the picture.  The insert-image function of this forum only enable to insert some html mark in edit-box without pop-up dialog to upload picture file.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: There is not Delete-Row function in Context menu.
« Reply #5 on: October 14, 2021, 09:05:11 am »
This example https://paramquery.com/pro/demos/context_menu doesn't have Delete row in the context menu.

whereas this https://paramquery.com/pro/demos/import-xlsx has "Delete row" in the context menu.

context menu is customizable and you can add as many items as you need.

Code: [Select]
{
    name: 'Delete row',
    icon: 'ui-icon ui-icon-trash',
    action: function (evt, ui) {
        this.deleteRow({
            rowIndx: ui.rowIndx
        })
    }
},

hyh888

  • Pro Enterprise
  • Full Member
  • *
  • Posts: 142
    • View Profile
Re: There is not Delete-Row function in Context menu.
« Reply #6 on: October 14, 2021, 11:29:00 am »
Get the point, thank you very much. Hope you can add "delete row" option in context menu sample (https://paramquery.com/pro/demos/context_menu ) to avoid other new comer making the same misunderstanding like me. Usually "delete row" and "delete column" option shoud in the muenu at the same time.
« Last Edit: October 14, 2021, 11:32:03 am by hyh888 »