Here i have pasted code ....please check so that i can remove " $.fn.dataTable.Editor is not a cons"
Here i have pasted code ....please check so that i can remove " $.fn.dataTable.Editor is not a cons"
gitanjali
Posts: 4Questions: 1Answers: 0
<?php
//require_once JPATH_ROOT . 'administrator/getuser.php';
/**
* @author JoomlaShine.com http://www.joomlashine.com
* @copyright Copyright (C) 2008 - 2011 JoomlaShine.com. All rights reserved.
* @license GNU/GPL v2 http://www.gnu.org/licenses/gpl-2.0.html
*/
// No direct access
defined('_JEXEC') or die('Restricted index access');
// Load template framework
if (!defined('JSN_PATH_TPLFRAMEWORK')) {
require_once JPATH_ROOT . '/plugins/system/jsntplframework/jsntplframework.defines.php';
require_once JPATH_ROOT . '/plugins/system/jsntplframework/libraries/joomlashine/loader.php';
}
// Preparing template parameters
JSNTplTemplateHelper::prepare();
// Get template utilities
$jsnutils = JSNTplUtils::getInstance();
<?php
>
<!DOCTYPE html>
language ?>" dir="<?php echo $this->direction; ?>">
?>
<meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0">
<title>Editor example - Customised control buttons</title>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.11/css/jquery.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.1.2/css/buttons.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/select/1.1.2/css/select.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="templates/jsn_solid_free/Data_Table/css/editor.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="templates/jsn_solid_free/Data_Table/examples/resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="templates/jsn_solid_free/Data_Table/examples/resources/demo.css">
<style type="text/css" class="init">
a.marginLeft {
margin-left: 1em;
}
</style>
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js">
</script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.10.11/js/jquery.dataTables.min.js">
</script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/buttons/1.1.2/js/dataTables.buttons.min.js">
</script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/select/1.1.2/js/dataTables.select.min.js">
</script>
<script type="text/javascript" language="javascript" src="templates/jsn_solid_free/Data_Table/js/dataTables.editor.min.js">
</script>
<script type="text/javascript" language="javascript" src="templates/jsn_solid_free/Data_Table/examples/resources/syntax/shCore.js">
</script>
<script type="text/javascript" language="javascript" src="templates/jsn_solid_free/Data_Table/examples/resources/demo.js">
</script>
<script type="text/javascript" language="javascript" src="templates/jsn_solid_free/Data_Table/examples/resources/editor-demo.js">
</script>
<script type="text/javascript" language="javascript" class="init
</script>
</head>
<body id="jsn-master" class="<?php echo $this->bodyClass ?>">
<div id="jsn-master_inner">
<script src="templates/jsn_solid_free/js/jquery.min.js"></script>
<script src="templates/jsn_solid_free/js/admin.js"></script>
<link rel="stylesheet" type="text/css" href="templates/jsn_solid_free/js/jquery.dataTables.css">
<script type="text/javascript" language="javascript" src="templates/jsn_solid_free/js/jquery.js"></script>
<script type="text/javascript" language="javascript" src="templates/jsn_solid_free/js/jquery.dataTables.js"></script>
<script type="text/javascript" language="javascript" class="init">
var editor; // use a global for the submit and return data rendering in the examples
$(document).ready(function() {
var dataTable = $('#student-grid').DataTable( {
"processing": true,
"serverSide": true,
"ajax":{
url :"../../templates/jsn_solid_free/js/student-grid-data.php", // json datasource
type: "post", // method , by default get
error: function(){ // error handling
$(".employee-grid-error").html("");
$("#employee-grid").append('<tbody class="employee-grid-error"><tr><th colspan="3">No data found in the server</th></tr></tbody>');
$("#employee-grid_processing").css("display","none");
}
}
} );
editor = new $.fn.dataTable.Editor( {
ajax: "../../templates/jsn_solid_free/Data_Table/examples/php/staff.php",
table: "#example",
fields: [ {
label: "First name:",
name: "first_name"
}, {
label: "Last name:",
name: "last_name"
}, {
label: "Position:",
name: "position"
}, {
label: "Office:",
name: "office"
}, {
label: "Extension:",
name: "extn"
}, {
label: "Start date:",
name: "start_date"
}, {
label: "Salary:",
name: "salary"
}
]
} );
var table = $('#example').DataTable( {
dom: "Bfrtip",
ajax: "../../templates/jsn_solid_free/Data_Table/examples/php/staff.php",
columns: [
{ data: null, render: function ( data, type, row ) {
// Combine the first and last names into a single table field
return data.first_name+' '+data.last_name;
} },
{ data: "position" },
{ data: "office" },
{ data: "extn" },
{ data: "start_date" },
{ data: "salary", render: $.fn.dataTable.render.number( ',', '.', 0, '$' ) }
],
select: true,
buttons: [
{ extend: "create", editor: editor },
{ extend: "edit", editor: editor },
{
extend: "selectedSingle",
text: "Salary +250",
action: function ( e, dt, node, config ) {
// Immediately add `250` to the value of the salary and submit
editor
.edit( table.row( { selected: true } ).index(), false )
.set( 'salary', (editor.get( 'salary' )*1) + 250 )
.submit();
}
},
{ extend: "remove", editor: editor }
]
} );
} );
</script>
<div class="container">
<section>
</div>
<!-- <div class="table">
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
</div> -->
<!-- <div class="ajax">
<p>This table loads data by Ajax. The latest data that has been loaded is shown below. This data will update automatically as any additional data is
loaded.</p>
</div>
<div class="php">
<p>The script used to perform the server-side processing for this table is shown below. Please note that this is just an example script using PHP. Server-side
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables
documentation</a>.</p>
</div> -->
</div>
</section>
</div>
</body>
</html>
Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This discussion has been closed.
Replies
Thanks for the code, but I have no idea what this relates to. In your other thread you also gave a code dump with no explanation. I'm afraid that in order to be able to offer any help I'm going to need to know what the issue is in the first place.
Also, per the forum rules, please link to a test case showing the issue, not just copy and pasting code.
Allan