Skip to content

Instantly share code, notes, and snippets.

@ka215
Created May 31, 2016 05:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ka215/bd84a89ac0b89e0084ab04d941ac4f6a to your computer and use it in GitHub Desktop.
Save ka215/bd84a89ac0b89e0084ab04d941ac4f6a to your computer and use it in GitHub Desktop.
In the dynamic table layout of Custom DataBase Table plugin, how to cancel a draggable table.
<?php
function table_layout_fixed( $component_options, $shortcode_name, $table ){
if ( 'cdbt-view' === $shortcode_name && 'your_table_name' === $table ) {
$component_options['customAfterRender'] = <<<EJS
$('#'+options.tableId).css({tableLayout:'auto'}).parent('.panel-table-wrapper').kinetic('detach');
EJS;
}
return $component_options;
}
add_filter( 'cdbt_shortcode_custom_component_options', 'table_layout_fixed', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment