My first commit of codes
This commit is contained in:
0
resources/views/vendor/.gitkeep
vendored
Normal file
0
resources/views/vendor/.gitkeep
vendored
Normal file
21
resources/views/vendor/Chumper/javascript.blade.php
vendored
Normal file
21
resources/views/vendor/Chumper/javascript.blade.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function(){
|
||||
|
||||
// dynamic table
|
||||
oTable = jQuery('#{{ $id }}').dataTable({
|
||||
"sPaginationType": "full_numbers",
|
||||
"bProcessing": false,
|
||||
@foreach ($options as $k => $o)
|
||||
{!! json_encode($k) !!}: {!! json_encode($o) !!},
|
||||
@endforeach
|
||||
|
||||
@foreach ($callbacks as $k => $o)
|
||||
{!! json_encode($k) !!}: {!! $o !!},
|
||||
@endforeach
|
||||
|
||||
});
|
||||
|
||||
oTable.addClass('table-striped ');
|
||||
|
||||
});
|
||||
</script>
|
20
resources/views/vendor/Chumper/options.blade.php
vendored
Normal file
20
resources/views/vendor/Chumper/options.blade.php
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
@if ($first = true && ($is_obj = false ) == false)
|
||||
@foreach ( $options as $k => $o )@if ( $first == false ),@endif
|
||||
@if ($first == true && ($first = false) == false)
|
||||
@if(!is_numeric($k))
|
||||
{!! '{'; $is_obj = true; !!}
|
||||
@else [@endif
|
||||
@endif
|
||||
@if (!is_numeric($k)){!! json_encode($k); $obj_parent = true !!}:@endif
|
||||
@if ( is_string($o))
|
||||
@if ( @preg_match("#^\s*function\s*\([^\)]*#", $o))
|
||||
{!! $o !!}@else
|
||||
{!! json_encode($o) !!}@endif
|
||||
@else
|
||||
@if (is_array($o) && ($obj = false) == false)@include(Config::get('chumper.datatable.table.options_view'), array('options' => $o))@else
|
||||
{!! json_encode($o) !!}@endif
|
||||
@endif
|
||||
@endforeach
|
||||
@if($is_obj)
|
||||
}@else]@endif
|
||||
@endif
|
27
resources/views/vendor/Chumper/template.blade.php
vendored
Normal file
27
resources/views/vendor/Chumper/template.blade.php
vendored
Normal 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, 'callbacks' => $callbacks))
|
||||
@endif
|
Reference in New Issue
Block a user