Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Rimokas

Pages: [1] 2 3
1
Woww  !

I changed in php "id" - > "value" and "text" -> "label"

It's working FINE! Thanks you! Problem solved ... :)


2
Thanks for your reply ...

Interesting ... The 2 columns model, with 1 hidden not fit to me ... Because I'm having this columns both in the grid. Name is not editable. Now changing itemId, user must to see and item Name in the list ...
Sorry, your sample maybe works only with arrays ...

I tried something in other way. In Php from mysql I'm filling "id": as itemId and "text" : as itemId + itemName .
It return fine . But ... the select isn't seeing "text" dimension ... added picture, it show problem ...

Mine source - simply copied your and changed dimensions name, "id" and "text" :
Code: [Select]
function autoCompleteEditor( source, di ) {
    return function (ui) {
        ui.$cell.addClass('ui-front');//so that dropdown remains with input.           
        //initialize the editor
        ui.$editor.autocomplete({                   
            source: source,
            position: {
                collision: 'flipfit',
                within: ui.$editor.closest(".pq-grid")
            },
    select: function (event, ui2) {
ui.$editor.val( ui2.item.text ); // display the selected text
ui.rowData[di] = ui2.item.id; // save selected id
return false;
            },
            minLength: 0
        }).focus(function () {
            //open the autocomplete upon focus               
            $(this).autocomplete("search", "");
        });
    }
}

The main difference here, that your source is "ships" array, not php query response ...

Maybe something not understand ?



3
Hi,

Did something similar, like "inline editing" with autocomplete. It's working. Now I did with one table field.
I want to do return with 2 fields. Let say "itemId" and "itemName" . But after choise save in cell "itemId". How to do that ?

mine source :

Code: [Select]
combo_box = ( source ) =>
{
   var func = function( ui )
   { 
      ui.$cell.addClass('ui-front')
      ui.$editor.autocomplete(
      {
         source  : source,
         position:
         {
            collision: 'flipfit',
            within: ui.$editor.closest( ".pq-grid" )
         },
         selectItem   : { on: true }, //custom option
         highlightText: { on: true }, //custom option
         minLength    : 0
      }).focus( function()
      {
         $( this ).autocomplete( "search", "" )
      })
   }
   return func
}

... itemId colmodel column editor

               colMd[ t ].editor =
               {
                  type: "textbox",
                  init: combo_box( 'phpf/prg_combo.php?tps=' + myParam ) // added own needful parameter
               }

Thanks in advance ... :)

4
Help for ParamQuery Pro / Re: Hearder menu - class 'pq-header-menu'
« on: September 26, 2021, 12:23:30 am »
Forget it,

I did own overlay dialog with show/hde columns ... It works fine ...
Thanks ... :)

5
Help for ParamQuery Pro / Re: Hearder menu - class 'pq-header-menu'
« on: September 25, 2021, 11:14:35 am »
Hi,

Now columns show/hide panel is visible through column header menu
Code: [Select]
menuIcon: true,
            menuUI:{
                tabs: ['hideCols']
            },

But if to disable "menuIcon: false,", then I can't to use columns show/hide ...
Let say that I have outside button, there I can to call this column show/hide dialog. Not in the grid toolbar, but with outside of the grid ...

Of course I can play with context menu - hiding from them is easy. But if to show ... So maybe exist possibility to call this dialog from outside button or from contextmenu ?

Thanks ...

6
Help for ParamQuery Pro / Hearder menu - class 'pq-header-menu'
« on: September 24, 2021, 07:01:44 pm »
Hi,

exist possibility to move call of show/hide dialog in outside button ? When not to show menuicon in headers, then I can't to call show/hide of columns dialog ...

Thanks ...

7
Ok, I solved dialog problem with another popup solution - it's working ...

Thank you!  ;D

8
Thanks for the answers! :)

with the second - I did what you directed ... but it's not working with confirmation dialog "Yes" or "No" .
I added jpg picture ... In debugger you can see that direction to function exist ... until confirm . It not appears ...  :-\
It return nothing - no error, no reaction ... :(  How to solve that ?

confirm - jqueryui dialog with defered :
Code: [Select]
window.confirm = function( message_confirm )
{
   var defer = $.Deferred();
   $( '<div/>', { title: 'Question!', 'class': 'confirm', 'id': 'dialogconfirm', text: message_confirm } )
   .dialog(
   {
      buttons:
      {
         Taip: function()
         {
            defer.resolve( "yes" )
            $( this ).attr( 'yesno', true)
            $( this ).dialog( 'close' )
         },
         Ne: function()
         {
            defer.resolve( "no" )
            $( this ).attr( 'yesno', false )
            $( this ).dialog( 'close' )
         }
     },
     close: function()
     {
       if ( $( this ).attr( 'yesno' ) === undefined )
       {
           defer.resolve( "no" )
       }
       $( this ).remove()
     },
     draggable: true,
     modal    : true,
     resizable: false,
     width    : 'auto',
     hide     : { effect: "fade", duration: 300 }
  })
  return defer.promise()
}

9
Hi,

have some problems with toolbars.

1-st - Exist possibility to enable/disable toolbar buttons, like in the contextMenu? In contextMenu is option "disabled" - so I can control this. How to control buttons in toolbar for conditions from record ?

2-nd - I'm formatting toolbar from database table with php ... It return object of items. One problem, from php return as json object. So javascript function name in object for listener is as string, for example - listener: { click: "grid_gen" } . Then to click on this button, it runs here ( from 6773 line )
Code: [Select]
_onEvent: function(e, n, r) {
return function(i) {
var o = r.type;
"checkbox" == o ? r.value = t(i.target).prop("checked") : r.value = t(i.target).val(), n.call( e, i ), "file" == o && t(this).val("")
}
},

It fails in n.call() . I tried, to change it to "window[ n ].call( e, i )" . Then it run ... But if in function have confirmation or other dialogs it not run ...

How to run own function from string as I wanna ? How to override "listener" methods ?

Or maybe I something don't understanding, how to work with toolbars ...  :-\. Sorry, but documnetation and samples not helped to me ... 

Thanks ...


10
Help for ParamQuery Pro / Re: Header filter row - without UI
« on: September 17, 2021, 10:47:23 am »
Hi,

found how to do what I want - simply directed to condition "regexp" ...

Works fine! :)

Thanks !

11
Help for ParamQuery Pro / Header filter row - without UI
« on: September 16, 2021, 10:02:53 pm »
Hi,

exist possibility to get filters row fields without UI ? Now integer field filter, if to select input, return dialog in which I must to select numbers ... But I wanna to write directly in the input, without any dialogs or UI . Simply "1", or ">10" and etc ... In server side I'm analyzing this input doing own select ...
Now it's available in "string" type columns. But I want it and to other types ...
How to remove dialogs from inputs ?

Thanks ...

12
Hi,

Added this :
Code: [Select]
         beforeFilter   : function( evt ){ pqVS.init() },         

Now it works fine ...

13
Hi,

Can't understand what I'm missing ...  :-[

Did grid with remote virtual scrolling - it works very fine. Almost identical to this sample : https://paramquery.com/demos/virtual_scroll
Now added filtering. If to fill value for filtering, I'm seeing that all is working - it return from php data.
But ... the view in datagrid changes for returned lines ( let say that return 17 lines, grid conteiner is in full widtht/height ) and leaves old lines after new data lines ... :( If to click for sorting, then renew data and then it view correct ...
What is bad ?

Mine js :

Code: [Select]
   for ( var u in kortos )
   {
      var grd_id = kortos[ u ].grido_id // grido ID

      var pqVS =
      {
         rpp: ( kortos[ u ].limitas * 1 ),
         init: function ()
         {
            this.totalRecords = 0;
            this.requestPage = 1;
            this.data = [];
         }
      }
      pqVS.init()
     
      var grd_obj =
      {
         width          : '98%',
         height         : '96%',
         virtualX       : true,
         virtualY       : true,
         resizable      : true,
         reactive       : true,
         scrollModel    : { autoFit: false },
         flex           : { one: true },
         numberCell     : { show: false },
         showHeader     : true,
         columnBorders  : true,
         rowBorders     : true,
         selectionModel : { type: 'cell' },
         stripeRows     : true,
         sortable       : true,
         sortModel      : { type: 'remote', single: false, sorter: [], space: true, multiKey: null },
         beforeSort     : function( evt ){ if ( evt.originalEvent ){ pqVS.init(); } },         
         filterModel    : { type: 'remote', on: true, header: true },
         beforeTableView: function( evt, ui )
         {
            var initV = ui.initV,
                finalV = ui.finalV,
                data = pqVS.data,
                rpp  = pqVS.rpp,
                tot  = pqVS.totalRecords,
                requestPage;
            if ( initV != null )
            {
               if ( data[ initV ] && data[ initV ].pq_empty )
               {
                  requestPage = Math.floor( initV / rpp ) + 1
               }
               else if ( data[ finalV ] && data[ finalV ].pq_empty )
               {
                  requestPage = Math.floor( finalV / rpp ) + 1
               }
           
               if ( requestPage >= 1 )
               {
                  if ( pqVS.requestPage != requestPage )
                  {
                     pqVS.requestPage = requestPage;
                     this.refreshDataAndView();
                  }
               }
            }
         }
      }
     
      grd_obj.colModel = gridai[ grd_id ].grido_conf.columns

      grd_obj.dataModel =
      {
         dataType : "JSON",
         location : "remote",
         url      : 'phpf/prg_crud.php',
         recIndx  : 'irs_id',
         postData : function()
         {
            var pst = {}
            pst[ "pq_curpage" ] = pqVS.requestPage
            pst[ "pq_rpp"     ] = pqVS.rpp
            pst[ "cmd"        ] = 'get'
            pst[ "pnk"        ] = pusl_prm
            pst[ "grd"        ] = grd_id
            return pst;
         },
         getData : function( response )
         {
            if ( response.status !== 'error' )
            {
               var data         = response.data,
                   totalRecords = response.totalRecords,
                   curPage      = response.curPage,
                   len          = data.length,
                   pq_data      = pqVS.data,
                   init         = ( curPage - 1 ) * pqVS.rpp;
               
               if ( !pqVS.totalRecords )
               {                   
                  for ( var i = len; i < totalRecords; i++ )
                  {
                      pq_data[ i + init ] = { pq_empty: true };
                  }
                  pqVS.totalRecords = totalRecords;
               }
               for ( var i = 0; i < len; i++ )
               {
                  pq_data[ i + init ] = data[ i ];
                  pq_data[ i + init ].pq_empty = false;
               }
               return { data: pq_data }
            }
            else
               setTimeout( () => { walert( response.message, 'php' ) }, 100 )
         },
         error: function( jqXHR, textStatus, errorThrown )
         {
             //alert(errorThrown);
         }
      }

      $( "#konteineris" ).pqGrid( grd_obj );
     
   }

grids columns ( from dev console - columns created in php side ) :

Code: [Select]
0:
align: "left"
columnDrag: true
dataIndx: "ord_id"
filter: {crules: Array(1), listeners: Array(1)}
hidden: false
resizable: true
sortable: true
title: "Užsakymo ID"
width: "127"
[[Prototype]]: Object
1: {dataIndx: 'item_id', title: 'Modelis', width: '127', hidden: false, columnDrag: true, …}
2: {dataIndx: 'prekes_pvd', title: 'Pavadinimas', width: '127', hidden: false, columnDrag: true, …}
3: {dataIndx: 'ord_model', title: 'Nav modelis', width: '100', hidden: false, columnDrag: true, …}
4: {dataIndx: 'ord_qnt', title: 'Kiekis', width: '62', hidden: false, columnDrag: true, …}
5: {dataIndx: 'ord_color', title: 'Spalva', width: '65', hidden: false, columnDrag: true, …}
6: {dataIndx: 'ord_date', title: 'Užsak.data', width: '93', hidden: false, columnDrag: true, …}
7: {dataIndx: 'ord_week', title: 'Užsak.sav.', width: '90', hidden: false, columnDrag: true, …}
8: {dataIndx: 'ret_date', title: 'Graž.data', width: '80', hidden: false, columnDrag: true, …}
9: {dataIndx: 'ret_week', title: 'Grąž.sav.', width: '90', hidden: false, columnDrag: true, …}
10: {dataIndx: 'fact_date', title: 'Fakt.data', width: '99', hidden: false, columnDrag: true, …}
11: {dataIndx: 'fact_week', title: 'Fakt.sav.', width: '90', hidden: false, columnDrag: true, …}
12: {dataIndx: 'mint_fact', title: 'Minut.', width: '100', hidden: false, columnDrag: true, …}
13: {dataIndx: 'sew_sum', title: 'Suma', width: '100', hidden: false, columnDrag: true, …}

Thanks in advance ...

14
Help for ParamQuery Pro / Re: Newbie in React and ParamQuery
« on: September 14, 2021, 10:47:45 pm »
Hi,

after some search and debugging I run vue sample ... Now it's working.

Main changes :
- in postData
Code: [Select]
      postData: function()
      {
         var pst = {}
         pst[ "pq_curpage" ] = pqVS.requestPage
         pst[ "pq_rpp"     ] = pqVS.rpp
         return pst;
      },

- in a dataModel :
Code: [Select]
dataModel: this.$options.data1
remote.php :
Code: [Select]
<?php

    
require_once 'conf2.php';

    
$dbh getDatabaseHandle();
                
    
$sql "select orders.*, items.prekes_pvd from orders 
    left join items on items.prekes_id = orders.item_id and items.prekes_tipo_id ='prod'"


    
$url $_SERVER'QUERY_STRING' ];
    
parse_str$url$rqs );
    
$pq_curPage $rqs"pq_curpage" ];
    
$pq_rPP$rqs"pq_rpp" ];
    
    
$sqt "Select count(*) from orders";
    
$stmt $dbh->query($sqt);    
    
$total_Records $stmt->fetchColumn();
    
    
$skip = ($pq_rPP * ($pq_curPage 1));
    if (
$skip >= $total_Records)
    {        
        
$pq_curPage ceil($total_Records $pq_rPP);
        
$skip = ($pq_rPP * ($pq_curPage 1));
    }
    
$sql .= " limit " $skip ", " .$pq_rPP;
    
$stmt $dbh->query($sql);
    
$rows $stmt->fetchAll(PDO::FETCH_ASSOC);

    
$jrt = [];   
    
$jrt"totalRecords" ] = $total_Records;
    
$jrt"curPage" ] = $pq_curPage;
    
$jrt"data" ] = $rows;
    echo 
json_encode$jrt );

?>


But ... if to work with Vue only through browser, backend not "node" as a sample - working speed is slowly ... maybe it needs other dependences in the browser, at this time I don't know ...

Then I tried with additionals changes and with react - surprise, but react speed was great as with usual jquery ...

react html:
Code: [Select]
<!DOCTYPE html>
<html lang="lt">
<head>
   <meta charset=utf-8 />
   <meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://unpkg.com/[email protected]/jquery-ui.css" rel="stylesheet" />
<link href="https://unpkg.com/[email protected]/jquery-ui.structure.css" rel="stylesheet" />
<link href="https://unpkg.com/[email protected]/jquery-ui.theme.css" rel="stylesheet" />

<script src="https://unpkg.com/[email protected]/dist/jquery.js"></script>
<script src="https://unpkg.com/[email protected]/jquery-ui.js"></script>
   
<link href="dist/pqgrid.min.css" rel="stylesheet" />
<link href="dist/pqgrid.ui.min.css" rel="stylesheet" />

<link href="dist/themes/chocolate/pqgrid.css" rel="stylesheet" />

<script src="dist/pqgrid.min.js"></script>

<script src="dist/pq-localize-en.js"></script>
<script src="dist/pq-localize-lt.js"></script>

   <script src="dist/react.development.js"></script>
   <script src="dist/react-dom.development.js"></script>
   <script src="dist/babel.js"></script>
</head>

<body>
   <div id="app" style="height: 99vh;" ></div>
   <script type = "text/babel" src="index.js"></script>
</body>
</html>

react.js (index.js - must call as type "text/babel" ) :

Code: [Select]
class Pqgrid extends React.Component
{
   componentDidMount()
   {
      this.options = this.props.options
      pq.grid( this.refs.grid, this.options )
   }
   
   componentDidUpdate(prevProps)
   {
      Object.assign( this.options, this.props.options )
   }
   
   render()
   {
      return <div style={{ height: '90vh'}} ref="grid" ></div>
   }
}

class App extends React.Component
{
   constructor( props )
   {
      super( props )
     
      this.handleChange = this.handleChange.bind( this );
   
      var pqVS =
      {
         rpp: 500,
         init: function()
         {
            this.totalRecords = 0
            this.requestPage  = 1
            this.data = []
         }
      }
      pqVS.init();

      this.columns1 =
      [
         { title: "Order ID", width: 100, dataIndx: "ord_id" },           
         { title: "Product Id", width: 190, dataIndx: "item_id" },
         { title: "Product Name", width: 250, dataIndx: "prekes_pvd" },
         { title: "Quantity", width: 100, dataIndx: "ord_qnt", align:"right" },           
         { title: "Order Date", width: 100, dataIndx: "ord_date"},
         { title: "Order Week", width: 100, dataIndx: "ord_week"},
         { title: "Return Date", width: 100, dataIndx: "ret_date" },
         { title: "Return Week", width: 100, dataIndx: "ret_week" },
         { title: "Fact Date", width: 100, dataIndx: "fact_date" },
         { title: "Fact Week", width: 100, dataIndx: "fact_week" },
      ]
     
      this.data1 =
      {
          dataType: "JSON",
          location: "remote",
          url: "phpf/remote.php",
          postData: function()
          {
             var pst = {}
             pst[ "pq_curpage" ] = pqVS.requestPage
             pst[ "pq_rpp"     ] = pqVS.rpp
             return pst;
          },
          getData: function( response )
          {
            var data = response.data,
               totalRecords = response.totalRecords,
               len = data.length,
               curPage = response.curPage,
               pq_data = pqVS.data,
               init = ( curPage - 1 ) * pqVS.rpp;

            if ( !pqVS.totalRecords )
            {                   
               for ( var i = len; i < totalRecords; i++ )
               {
                  pq_data[ i + init ] = { pq_empty: true }
               }
               pqVS.totalRecords = totalRecords
            }
            for ( var i = 0; i < len; i++ )
            {
               pq_data[ i + init ] = data[ i ]
               pq_data[ i + init ].pq_empty = false
            }
            return { data: pq_data }
         },
         error: function ( jqXHR, textStatus, errorThrown)
         {
             //alert(errorThrown);
         }
      }
     
      this.state =
      {
         reactive: true,
         width: '98%',
         height: '96%',
         showTitle: false,
         locale: 'lt',
         menuIcon: false,
         collapsible: { on: false, toggle: false },
         resizable: true,
         reactive: true,
         scrollModel: { autoFit: false },
         flex:{one: true},
         numberCell: { show: false },
         showHeader: true,
         columnBorders: true,
         rowBorders: true,
         selectionModel: { type: 'cell' },
         stripeRows: true,
         filterModel: { header: false },
         beforeTableView: function( evt, ui )
         {

            var initV = ui.initV,
                finalV = ui.finalV,
                data = pqVS.data,
                rpp = pqVS.rpp,
                requestPage;
           
            if ( initV != null )
            {
               if ( data[ initV ] && data[ initV ].pq_empty )
               {
                  requestPage = Math.floor( initV / rpp ) + 1
               }
               else if ( data[ finalV ] && data[ finalV ].pq_empty )
               {
                  requestPage = Math.floor( finalV / rpp ) + 1
               }
           
               if ( requestPage >= 1 )
               {
                  if ( pqVS.requestPage != requestPage )
                  {
                     pqVS.requestPage = requestPage
                     this.refreshDataAndView()
                  }
               }
            }
         },
         colModel: this.columns1,
         animModel: { on: true },
         dataModel: this.data1
      }
   }
   
   handleChange( event )
   {
      this.setState( { locale: event.target.value } )
   }
 
   render()
   {
      return <div>
         <div style={{ margin: 20 }}>
           <label>Change locale:</label>
           <select value={this.state.locale} onChange={this.handleChange}>
             <option value="lt">Lthuania</option>
             <option value="en">English</option>
           </select>
         </div>

         <Pqgrid options={this.state} />
      </div>
   }
}

ReactDOM.render(
  <App />,
  document.getElementById( 'app' )
)

The remote the same ...

Thanks for help ... and will ask in the future ... :)





15
Help for ParamQuery Pro / Re: Newbie in React and ParamQuery
« on: September 12, 2021, 08:10:53 pm »
Hi,

Stackblitz ... for backend use node and similar techs ...
Mine sample is on wamp. No node, no next ...

html file :
Code: [Select]
<!DOCTYPE html>
<html lang="lt">
<head>
   <meta charset=utf-8 />
   <meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://unpkg.com/[email protected]/jquery-ui.css" rel="stylesheet" />
<link href="https://unpkg.com/[email protected]/jquery-ui.structure.css" rel="stylesheet" />
<link href="https://unpkg.com/[email protected]/jquery-ui.theme.css" rel="stylesheet" />

<script src="https://unpkg.com/[email protected]/dist/jquery.js"></script>
<script src="https://unpkg.com/[email protected]/jquery-ui.js"></script>
   
<link href="dist/pqgrid.min.css" rel="stylesheet" />
<link href="dist/pqgrid.ui.min.css" rel="stylesheet" />

<link href="dist/themes/chocolate/pqgrid.css" rel="stylesheet" />

<script src="dist/pqgrid.min.js"></script>

<script src="dist/pq-localize-en.js"></script>
<script src="dist/pq-localize-lt.js"></script>

   <script src="dist/vue.js"></script>
</head>

<body>
   <div id="app">
<div style="margin:20px;">
<label>Change locale:</label>
         <select v-model="options.locale">
            <option value="en">English</option>
            <option value="lt">Lithuania</option>
         </select>
      </div>
      <pq-grid :options="options"></pq-grid>
    </div>
    <script src="index2.js" ></script>
</body>
</html>

js file (index2.js):

Code: [Select]
var pqVS =
{
   rpp: 500,
   init: function()
   {
      this.totalRecords = 0
      this.requestPage  = 1
      this.data = []
   }
}
pqVS.init();
     
Vue.component( "pq-grid",
{
  props: ["options"],
  mounted: function()
  {
    pq.grid(this.$el, this.options);
  },
  template: '<div :options="options"></div>'
});

var app = new Vue(
{
   el: "#app",
   columns1:
   [
      { title: "Order ID", width: 100, dataIndx: "ord_id" },           
      { title: "Product Id", width: 190, dataIndx: "item_id" },
      { title: "Product Name", width: 250, dataIndx: "prekes_pvd" },
      { title: "Quantity", width: 100, dataIndx: "ord_qnt", align:"right" },           
      { title: "Order Date", width: 100, dataIndx: "ord_date"},
      { title: "Order Week", width: 100, dataIndx: "ord_week"},
      { title: "Return Date", width: 100, dataIndx: "ret_date" },
      { title: "Return Week", width: 100, dataIndx: "ret_week" },
      { title: "Fact Date", width: 100, dataIndx: "fact_date" },
      { title: "Fact Week", width: 100, dataIndx: "fact_week" },
   ],
   data1:
   {
      dataType: "JSON",
      location: "remote",
      url: "phpf/remote.php",
      postData: function()
      {
         return
         {
            pq_curpage = pqVS.requestPage,
            pq_rpp = pqVS.rpp
         };
      },
      getData: function( response )
      {
           var data = response.data,
           totalRecords = response.totalRecords,
           len = data.length,
           curPage = response.curPage,
           pq_data = pqVS.data,
           init = ( curPage - 1 ) * pqVS.rpp;

        if ( !pqVS.totalRecords )
        {                   
           for ( var i = len; i < totalRecords; i++ )
           {
              pq_data[ i + init ] = { pq_empty: true }
           }
           pqVS.totalRecords = totalRecords
        }
        for ( var i = 0; i < len; i++ )
        {
           pq_data[ i + init ] = data[ i ]
           pq_data[ i + init ].pq_empty = false
        }
         return { data: pq_data }
      },
      error: function ( jqXHR, textStatus, errorThrown)
      {
          //alert(errorThrown);
      }
   },
   data: function()
   {
      this.options =
      {
         showTitle: false,
         reactive: true,
         locale: "lt",
         height: "flex",
         numberCell: { show: false },
         columnTemplate: { width: 100 },
         colModel: this.$options.columns1,
         animModel: { on: true },
         dataModel: this.data1 //{ data: this.$options.data1 }
      };
      return {};
   }   
});

php file ( remote.php ) :

Code: [Select]
<?php

    
require_once 'conf2.php';

    
$dbh getDatabaseHandle();
                
    
$sql "select orders.*, items.prekes_pvd from orders 
    left join items on items.prekes_id = orders.item_id and items.prekes_tipo_id ='prod'"


    
$pq_curPage $_GET["pq_curpage"];
    
$pq_rPP=$_GET["pq_rpp"];
    
    
$sqt "Select count(*) from orders";
    
$stmt $dbh->query($sqt);    
    
$total_Records $stmt->fetchColumn();
    
    
$skip = ($pq_rPP * ($pq_curPage 1));
    if (
$skip >= $total_Records)
    {        
        
$pq_curPage ceil($total_Records $pq_rPP);
        
$skip = ($pq_rPP * ($pq_curPage 1));
    }
    
$sql .= " limit " $skip ", " .$pq_rPP;
    
$stmt $dbh->query($sql);
    
$rows $stmt->fetchAll(PDO::FETCH_ASSOC);
    
$sb "{\"totalRecords\":" $total_Records ",\"curPage\":" $pq_curPage ",\"data\":".json_encode($rows)."}";
    echo 
$sb;

?>


You can change "select * from " in php for your own "select" and "columns1" according to data table "select ...".

That is all ...

Mine purpose is to try vue with virtual remote scrolling like in this sample : https://paramquery.com/pro/demos/virtual_scroll

Maybe I don't understand - maybe vue in this way ( only from browser ) can't work ...  :-\







Pages: [1] 2 3