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 - Bawzee

Pages: [1]
1
Help for ParamQuery Pro / Re: Implementing Callback Properly
« on: February 08, 2017, 11:33:26 pm »
When I try to simulate building the dataModel data array with a 3 second timeout and passing it through to the grid, it works properly the way it should work so I'm unable to reproduce the issue this way. 

I'm thinking the issue may be related to way I have coded the function I'm using to call the data as I am new to working with javascript.  This is pretty much the actual code I'm using to build the data array.  I know this may not be a paramquery issue, but I was wondering if you noticed anything in my code that might be causing the issue:

Code: [Select]
function getMyTable(callback){
    const sqlite3 = require('sqlite3').verbose();


        var testoCommerceDB = new sqlite3.Database('app/data/testo_commerce.db');
        var myTable = [];
        var myTableRow = [];

        testoCommerceDB.each("SELECT * FROM myTable_Accounts", function(err, row) {
           
            myTableRow.push(row.myTable_id);
            myTableRow.push(row.myTable_creation_date);
            myTableRow.push(row.domain);
            myTableRow.push(row.myTable_login_url);
            myTableRow.push(row.myTable_username);
            myTableRow.push(row.myTable_password);
            myTableRow.push(row.myTable_ip);
            myTableRow.push(row.whm_account_name);

            myTable.push(myTableRow);
            myTableRow = [];
        });
        testoCommerceDB.close();
        callback(myTable);
       
        console.log(myTable);
}

2
Help for ParamQuery Pro / Re: Implementing Callback Properly
« on: February 08, 2017, 07:01:28 pm »
Quote
Do you initially see the message inside the grid: "No rows to display"

Yes, I do initially see the message "No rows to display".

This is the code for the click event listener"

Code: [Select]
{ type: 'button', icon: 'ui-icon-plus', label: 'Add Account', listener: function () {
                            var rowData = { 2:  "" }; //empty row
                            $grid.pqGrid("addRow", { rowData: rowData, rowIndxPage: 0 });
                            $grid.pqGrid("setSelection", null);
                            $grid.pqGrid("setSelection", { rowIndxPage: 0, dataIndx: 2 });
                            $grid.pqGrid("editFirstCellInRow", { rowIndxPage: 0 });                       
                        }
}

As soon as I click this button to add a row to the grid, all of the data populates to the grid as well as the blank new row being displayed for editing and saving.

I appreciate your help with this.


3
Help for ParamQuery Pro / Re: Implementing Callback Properly
« on: February 07, 2017, 08:11:51 pm »
This is my dataModel:

dataModel: { data: gridData, recIndx: 0 }

the gridData is the array that is passed to this function in the callback.  And it works as in it does pass through and will populate the grid, but only displays the data in the grid after a refresh.  Or if I wrap
 
Code: [Select]
var $grid = $("#main_grid").pqGrid(obj);
in a setTimeout function for half a second, the grid will instantiate with all the data.  But I know that is the wrong way to fix this issue so I'd rather not rely on that.

4
Help for ParamQuery Pro / Implementing Callback Properly
« on: February 07, 2017, 06:57:40 pm »
Hi Paramvir,

I am new to the asynchronous nature of javascript and am having difficulty making the grid wait for my data before displaying.  Here are the bullet points for this scenario.  I'm hoping I can get away without providing a lot of code, but I will do whatever is needed to get this particular issue resolved. 

  • The app is being created with node.js and Electron.
  • I have one function that fetches the data from an SQLite database residing on the local hard drive the app is on.
  • I have another function that has all the code to display the grid.

So the code looks something like this:

Code: [Select]
function getGridData(callback) {
    <--the code to get the grid data for the dataModel-->
    callback(gridData);
}

function displayGrid (gridData){
   <--the code to define and display the grid-->
    var $grid = $("#main_grid").pqGrid(obj);
}

getGridData(displayGrid);

When i run the script, a blank grid with no gridData is diplayed.  If I click any button on the grid toolbar that gets the instance of the grid, all of the data is then displayed so I know the callback executed and passed the data to the displayGrid function.  Also if I put a short timeout around the
Code: [Select]
var $grid = $("#main_grid").pqGrid(obj);
statement, the grid is initialize properly with all gridData so again, I know the callback is working and passing the gridData, but the displayGrid is displaying without waiting for the dataModel data.  This is driving me crazy so if you can help me with this, I would be very appreciative.

Thanks,
Bawzee

5
ParamQuery Pro Evaluation Support / Re: Sqlite As The DataSource
« on: January 25, 2017, 01:36:33 am »
Thank you.  That is what i though, but wanted to be sure.

6
ParamQuery Pro Evaluation Support / Sqlite As The DataSource
« on: January 24, 2017, 03:28:08 am »
Am I limited to mySql as the database or can I use Sqlite or other database engines?

7
Thank you, sir.  I really appreciate your help with this.

8
Thank you again for your assistance with this matter. So here is the fiddle:  http://jsfiddle.net/Bawzee/4j6ya0L1/2/

So were starting with a  blank table and will be adding the first record by clicking the Add Domain button.  When I go to edit the row, all fields are editable and retain their data except for the Registrar Select Drop Down.  I'm able to select an option, but when I tab out or click another cell in the data I selected disappears from the Select cell.

9
Yeah, I thought my code appeared correct based on the Demo examples, which made it all the more confusing as to why it does not work.

Before I provide a fiddle, I noticed that there is a pqSelect folder in the Paramquery Pro download that contains pqselect js and css files, yet I saw no indication on this page that these were required dependencies for version 3.3.  http://paramquery.com/pro/tutorial   

Please confirm this is the case.

Thank you.

10
Thank you for your reply.  It is very much appreciated.  I've been stuck on what will likely turn out to be a very simple issue for a couple of days now and I really need to get it figured out.  I've tried this:

Code: [Select]
{ title: "Test", width: 130, dataIndx: 1,
                filter: { type: 'textbox', condition: 'begin', listeners: ['keyup'] },
                editor: {
                    type: 'select',
                    init: function (ui) {
                       ui.$cell.find("select").pqSelect();
                    },
                    options: [,1,2,3,4,5],
                   
                },
            }

and this:

Code: [Select]
{ title: "Test", width: 130, dataIndx: 1,
                filter: { type: 'textbox', condition: 'begin', listeners: ['keyup'] },
                editor: {
                    type: 'select',
                    options: [,1,2,3,4,5],
                    getData: function (ui) {ui.$cell.find("select").pqSelect();}
                },
            }

but I get the same results, which is the dropdown works and displays ,1,2,3,4,5 and I can select any of the options, but when I tab or click out of the field, the value is blank and the selection does not appear to be retained.

With the exception of this snag, which I understand is likely due something I am doing wrong, I'm loving Paramquery so far and look forward to continuing my evaluation once I figure out how to make the select option work.  I really appreciate any assistance you can provide.

11
ParamQuery Pro Evaluation Support / Select Drop Down Will Not Keep Value
« on: January 18, 2017, 03:10:53 am »
So I have 1 column as shown:

Code: [Select]
var colM = [
             { title: "Test", width: 130, dataIndx: 0,
                filter: { type: 'textbox', condition: 'begin', listeners: ['keyup'] },
                editor: {
                    type: 'select',
                    options: [,1,2,3,4,5],
                    },
            }
]

When I select the value, it disappears after I tab to a new field.  I've looked at all the example and tried different code, but cannot get it to work.  I'm sure it's something simple I'm missing and there are 2 or 3 lines of code I can add to the column model above to make the value save after tabbing.  Any help is greatly appreciated.

Pages: [1]