This commit is contained in:
Manish Verma
2016-12-13 18:18:25 +05:30
parent fc98add11c
commit 2d8e640e9b
2314 changed files with 97798 additions and 75664 deletions

View File

@@ -0,0 +1,9 @@
<script type="text/javascript">
jQuery(document).ready(function(){
// dynamic table
oTable = jQuery('#{!! $id !!}').dataTable(
{!! $options !!}
);
});
</script>

View File

@@ -0,0 +1,27 @@
<table id="{!! $id !!}" class="{!! $class !!}">
<colgroup>
@for ($i = 0; $i < count($columns); $i++)
<col class="con{!! $i !!}" />
@endfor
</colgroup>
<thead>
<tr>
@foreach($columns as $i => $c)
<th align="center" valign="middle" class="head{!! $i !!}">{!! $c !!}</th>
@endforeach
</tr>
</thead>
<tbody>
@foreach($data as $d)
<tr>
@foreach($d as $dd)
<td>{!! $dd !!}</td>
@endforeach
</tr>
@endforeach
</tbody>
</table>
@if (!$noScript)
@include(Config::get('chumper.datatable.table.script_view'), array('id' => $id, 'options' => $options))
@endif

View File

@@ -0,0 +1,52 @@
<script type="text/javascript">
jQuery(document).ready(function () {
oTable = jQuery('#chumper').dataTable({
"sPaginationType": "full_numbers",
"bProcessing": true,
//"sAjaxSource": "{{url('filter')}}",
"bServerSide": true,
// "fnServerParams": function (aoData) {
// $("select[name=label]").change(function () {
// var labels = $("select[name=label]").val();
// aoData.push({"name": "thing", "value": "thingsvalue"});
// });
//
// },
"ajax": {
"type": "POST",
"url": '/myUrl/MyMethod/',
"contentType": 'application/json; charset=utf-8',
"data": function (data) {
return data = JSON.stringify(data);
}
},
"aaSorting": [[6, "desc"]],
"fnCreatedRow": function (nRow, aData, iDataIndex) {
var str = aData[3];
if (str.search("#000") == -1) {
$("td", nRow).css({"background-color": "#F3F3F3", "font-weight": "600", "border-bottom": "solid 0.5px #ddd", "border-right": "solid 0.5px #F3F3F3"});
$("td", nRow).mouseenter(function () {
$("td", nRow).css({"background-color": "#DEDFE0", "font-weight": "600", "border-bottom": "solid 0.5px #ddd", "border-right": "solid 0.5px #DEDFE0"});
});
$("td", nRow).mouseleave(function () {
$("td", nRow).css({"background-color": "#F3F3F3", "font-weight": "600", "border-bottom": "solid 0.5px #ddd", "border-right": "solid 0.5px #F3F3F3"});
});
} else {
$("td", nRow).css({"background-color": "white", "border-bottom": "solid 0.5px #ddd", "border-right": "solid 0.5px white"});
$("td", nRow).mouseenter(function () {
$("td", nRow).css({"background-color": "#DEDFE0", "border-bottom": "solid 0.5px #ddd", "border-right": "solid 0.5px #DEDFE0"});
});
$("td", nRow).mouseleave(function () {
$("td", nRow).css({"background-color": "white", "border-bottom": "solid 0.5px #ddd", "border-right": "solid 0.5px white"});
});
}
}}
);
$("select[name=label]").change(function () {
oTable.fnDraw();
});
});
</script>