Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Datatable Action menu does not open


Hi, Am have implemented this https://preview.keenthemes.com/metronic8/demo3/apps/user-management/users/list.html and was able to make the listing dynamic, but encountered a problem with the Action menu, it does not popup when clicked.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (6)


thank you so much, working great



Ben, could you please show how you solved it. Thanks


after setting the DataTable added KTMenu.createInstances(); on the on("draw"

$(o).DataTable({
 info: !1,
 order: [],
 searchDelay: 500,
 processing: true,
 serverSide: true,
 pagination:true,
 stateSave: true,
 type:'remote',
 ajax:{url: '/select/'+_data, data: {_token: _token}, method: 'post'},
 columns:[
 {data:'name'},
 {data:'role'},
 {data:'branch'},
 {data:'last_login'},
 {data:null}
 ],
 pageLength: 10,
 lengthChange: !1,
 columnDefs: [
 {targets: 0,
 className: 'd-flex align-items-center'},
 {targets: -3,
 data: null,
 orderable: false,
 className: 'text-end',
 render: function (data, type, row) {
 return `
 
 Actions
 
 
 
 
 
 
 
 
 
 
 
 
 `;
 },
 }]
 })).on("draw", (function () {
 l(), KTMenu.createInstances();
 })),

got it thank you Sean, checking on the document



Hi,

You will need to reinitialize the KT components when you deal with dynamically populated elements. You can refer to the Bootstrap KTMenu component API documentation here.

Regards.



data-kt-menu-trigger when clicked does not open the menu? do i need to reinitialise the menu?


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(