Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- $(function(){
- $("#accord").css("width", $('.row').width()-45);
- $("#dg").css("width", $('.row').width()-45);
- $('#error').hide();
- $('#from').val('');
- $('#to').val('');
- $('#dg').datagrid({
- pageSize: 50,
- pageList: [50,100,150,200],
- view: detailview,
- detailFormatter:function(index,row){
- return '<div class="ddv" style="padding:5px 0"></div>';
- },
- onCollapseRow: function(index,row){
- alert('test');
- },
- rowStyler:function(index,row){
- if (row.id>-1){
- return 'background-color:white;color:blue;font-weight:bold;';
- }
- if (row.id=1){
- return 'background-color:white;color:blue;font-weight:bold;';
- }
- if (row.id=-1){
- $('#dg').datagrid('reload');
- $('#error').show();
- $.messager.show({
- title:'Response',
- msg:'Brak zwróconych wyników szukania'
- })
- }
- },
- onExpandRow: function(index,row){
- $('#jloading').html('<img src="themes/default/images/loading.gif">');
- var ddv = $(this).datagrid('getRowDetail',index).find('div.ddv');
- ddv.panel({
- height:1,
- border:true,
- cache:false,
- href:'listdetail.php?listnumb='+row.number,
- onLoad:function(){
- $('#dg').datagrid('fixDetailRowHeight',index);
- }
- });
- $('#dg').datagrid('fixDetailRowHeight',index);
- $.ajax({
- type: "GET",
- url: 'listdetail.php?listnumb='+row.number,
- success: function (d) {
- // replace div's content with returned data
- $('#jloading').html(d);
- }
- });
- $.ajax({
- type: "GET",
- url: 'listdetailsub.php?listnumb='+row.number,
- success: function (d) {
- // replace div's content with returned data
- $('#jinner').html(d);
- }
- });
- },
- onLoadSuccess:function(){
- $(this).datagrid('getPanel').find('.deleter').each(function(){
- $(this).linkbutton({
- onClick:function(){
- var id = $(this).attr('row-id');
- // destroy the row
- if (id){
- $.messager.confirm('Confirm','Are you sure you want to destroy this user?',function(r){
- if (r){
- //
- $.post('ajax/removelist.php',{entryid:id},function(result){
- if (result.success){
- $.messager.show({ // show error message
- title: 'Sukcess',
- timeout:10000,
- msg: result.LHN+'<br>'+result.List+'<br>'+result.Numb
- });
- $('#dg').datagrid('reload'); // reload the user data
- } else {
- $.messager.show({ // show error message
- title: 'Error',
- timeout:10000,
- msg: result
- });
- }
- },'json');
- //
- }
- });
- }
- }
- })
- })
- }
- });
- });
- function doSearch(){
- $('#error').hide();
- $('#dg').datagrid('load',{
- number: $('#number').val(),
- from: $('#from').val(),
- to: $('#to').val()
- });
- $('#from').val('');
- $('#to').val('');
- $('#number').val('');
- }
- function formatDetail(value,row){
- var href = 'landing.php?do=innerlist&list='+row.id+'&ln='+row.number;
- return '<center><a target="_blank" href="' + href + '" style="padding-right: 10px;"><span class="btn btn-primary btn-xs"><i class="fa fa-search"></i> Podgląd</span></a><a target="_blank" href="parse/dync.php?list='+row.number+'"><span class="btn btn-danger btn-xs"><i class="fa fa-file-pdf-o"></i> Pobierz</span></a><a style="padding-right: 10px;" class="deleter" href="#" row-id="'+row.id+'"><span class="btn btn-info btn-xs"><i class="fa fa-trash-o">Usuń<span></a></center>';
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement