Author Topic: Bootstrap Split Button + Checkbox Column  (Read 2248 times)

Webauthor

  • Pro OEM
  • Jr. Member
  • *
  • Posts: 51
    • View Profile
Bootstrap Split Button + Checkbox Column
« on: March 06, 2020, 11:10:07 pm »
Hi, I'd like to have a split button control on my checkbox column so I can have different actions for a row - e.g. Modify, Delete in addition to View.

Please see this fiddle - https://jsfiddle.net/webauthor/moj0yfsh/4/ - can you help me implement something like this?  Also, I'd like it that when the button is clicked, it does not fire the rowselect event.  I don't want the row to be selected when I click on a button because it's performing a different action - for that specific row.

Thanks

Webauthor

  • Pro OEM
  • Jr. Member
  • *
  • Posts: 51
    • View Profile
Re: Bootstrap Split Button + Checkbox Column
« Reply #1 on: March 16, 2020, 12:03:21 am »
Hi, any help on this?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Bootstrap Split Button + Checkbox Column
« Reply #2 on: March 16, 2020, 11:24:30 am »
Bootstrap split button in your jsfiddle was not working ( missing dependencies ) even outside the grid, so replaced it with jQueryUI selectmenu.

Quote
I don't want the row to be selected when I click on a button because it's performing a different action - for that specific row.

Attach click handler to cell and call evt.stopPropagation() in postRender callback.

Code: [Select]
postRender: function(ui){
          var $cell = this.getCell(ui)
          $cell.find('select').selectmenu()
          $cell.on('click', function(evt){
            evt.stopPropagation();                     
          })
},

https://jsfiddle.net/webauthor/moj0yfsh/4/