scroller and mssql

scroller and mssql

toontilleytoontilley Posts: 8Questions: 0Answers: 0
edited January 2013 in Plug-ins
First of all this is a great product and works wonders for my project.

One thing I'm struggling to achieve, is getting scroller to work with server-side processor with mssql.

I've used the ODBC script found under development but as soon I start to drag the scroller down it hangs on loading.

There are 78500 records which doesn't sound allot compared to some users on here.

Can any one give me some tips on where I might be going wrong??

Replies

  • toontilleytoontilley Posts: 8Questions: 0Answers: 0
    I think I've narrowed it down it would appear the SQL used for sQuery on the second scroll i.e records 10 to 20, which when I run in SQL server it doesn't work.

    SELECT TOP 10 Company_Name,WWW
    FROM Company
    WHERE Company_Id NOT IN (
    SELECT Company_Id
    FROM(
    SELECT TOP 10 Company_Name,WWW
    FROM Company
    ORDER BY Company_Name asc)
    as [virtTable] )
    ORDER BY Company_Name asc

    Will post back if I get a working query
  • toontilleytoontilley Posts: 8Questions: 0Answers: 0
    if it helps any one I got it to work by amending the original code to:

    /* Paging */
    $top = (isset($_GET['iDisplayStart']))?((int)$_GET['iDisplayStart']):0 ;
    $sLimit = ( isset($_GET['iDisplayLength']) )? ((int)$_GET['iDisplayLength'] ):10;

    if ($top <> 0 ) {
    $sLimit = $sLimit + $top;
    $top++;
    }

    $sQuery = "SELECT ".implode(",",$aColumns)."
    FROM (
    SELECT ".implode(",",$aColumns).", ROW_NUMBER() OVER ($sOrder) AS RowNum
    FROM $sTable
    $sWhere
    ) AS MyTable
    WHERE MyTable.RowNum BETWEEN $top AND $sLimit";
This discussion has been closed.