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

Pages: [1]
1
That is awesome!! Thanks again!  :) Hopefully this will help somebody else in the future.

I'll be making my recommendation this week to the big boss for approval. You have been most helpful which is greatly appreciated.

I do have one future request though to add a "complete" event the fires once all processing and loading is complete including all of the refreshes. We have some need for this so as to initiate other processes once the grid is loaded. I'll request this in the other part of the forum.

I'm looking forward to working with it.

Best regards,
Steve

2
I created a jsFiddle which closely emulates my code which produces the error "Unable to get property 'length' of undefined or null reference" when trying to load state:

http://jsfiddle.net/ydo9mobc/3/

Run it with developer tools (IE or Chrome) open to see the error.

Thanks,
Steve

3
That makes sense, but with the evaluation version being 3.1, your solutions don't work for me. :-)

You say to use
Code: [Select]
this.loadState( { refresh: false }); in the create event, it errors. I have tried

Code: [Select]
create:function( event, gridModels) {
     $(this).pqGrid('loadState', false);

It errors as well with a null reference. Removing the boolean variable results in the same thing.

Can you provide code sample that will do this in 3.1? I need to be able to show this as 100% working before we can proceed with license purchase and I have this week to make a final decision. And, btw, I appreciate the support you have provided so far in our evaluation. :-)

Regards,
Steve

4
I did some additional testing to trace the firing of "refresh" and "create" events. I found the following:

1. In simple, basic grids loading local data, "create" is the last event fired.

2. When loading remote data, one "refresh" event fires after "create" event.

3. When using "flex: { one: true }", "refresh" events fire after "create" event (actually, it appears to fire after the remote data "refresh" event).

So, when using all three steps above, this is what fires in my test environment:

1. refresh
2. create
3. load remote data
4. refresh
5. refresh

Here is where it gets even more interesting. :-)

If I wait until the third and final refresh, I can successfully invoke the "loadState" function which works like a charm:

Code: [Select]
//global variable
var refreshCount = 0;

//inside grid initialization
refresh: function( event, ui ) {
    refreshCount++;
    if(refreshCount == 3) {
        $(this).pqGrid('loadState');
    }
}

So, here is the event sequence with that in place:

1. refresh
2. create
3. load remote data
4. refresh
5. refresh
6. loadState (from code above)
7. load remote data
8. refresh

So, in summary, it would be great to have a "final" or "complete" event that fires after the grid fully completes and loads all data. Also, it appears that "load state" causes the remote data process to be triggered again? If that is correct, then there could be some performance issues for larger datasets....or data queries that require some extra processing time on the server side. In our application, such server side processes could include opening a few connections to servers/databases to obtain the data and can take up to several seconds. So, you see my concern. :-)

Regards,
Steve



5
ParamQuery Pro Evaluation Support / Loading Saved State On "create" Event
« on: October 22, 2015, 11:03:11 pm »
Greetings,

Is there a way to load the saved state of a grid automatically when loaded? The use case here is a user saving the state of the grid, visiting other pages, coming back, and the grid should load up that saved state. I reviewed the demo, but you have to click a button to load saved state. This needs to be done without a user having to click something. 

I cannot figure out how to do this. I try to put it int he "create" event handler, but I get " "unable to get property 'length' of undefined or null reference.

Code: [Select]
create:function (evt, ui) {
    $(this).pqGrid('loadState');
}

It seems to me that the "create" event is not really the last event of initializing and loading a grid.....or at least it is firing before all grid creation processes completely finish. The API says, "Triggered after the pqGrid is created."

I have run into this when trying to do something only after the grid is truly completed. I think there needs to be a "complete" event so that the grid is truly fully initialized and data is loaded so that you can invoke any grid method. As it is now, I know of no way to "wait" for everything to finish/complete before invoking something grid related as in "loadState". If there is a way, I'm all ears and would love to be enlightened as to how. :-)

Regards,
Steve

6
ParamQuery Pro Evaluation Support / Re: Collapsing Group Rows Issue
« on: October 15, 2015, 11:35:45 pm »
That worked!!!!  ;D ;D ;D

Thank you so much!

Regards,
Steve

7
ParamQuery Pro Evaluation Support / Re: Collapsing Group Rows Issue
« on: October 15, 2015, 09:06:41 pm »
I am not real clear when you say:

Quote
This code is for use in the latest version 3.2.0 where 'this' variable points to widget instance inside events, you would need to make appropriate change for old versions in which 'this' variable points to DOM element of the grid inside the events.

I tried this in the "load" event per your previous code snippet and the alert never fires (but the load event does fire as I tested. And, there are no JS errors for widget.one()):

Code: [Select]
var widget = $("#" + paramQueryGridId).pqGrid( "widget" );
widget.one("refresh", function(){
     alert(120);
     widget.flex();
     var collapsed = groupModel.collapsed;
     for(var i=0;i<collapsed.length;i++){
           collapsed[i]=true;
     }
     widget.refreshView();
});

I could use a code example of "pointing to the DOM element of the grid inside the events". I'm confused. If the target div is "myTargetGrid", do I point at that inside the load event like this?

Code: [Select]
load:function(evt, ui) {
     $("#myTargetGrid").one("refresh", function() {
          .....
     }
}

I tried that and it too doesn't work.

I am using the evaluation copy, so I am not sure which version that is. I assumed it was 3.2.x. The demos I am running on the website are "Demos 3.x". In the jsfiddle link I posted previously, I looked at the paramquery javascript being used and it is v2.4.1.

Given that I get an error complaining about the use of "this" in the load event function, I am not sure which version I am actually using for evaluation.

   

8
ParamQuery Pro Evaluation Support / Re: Collapsing Group Rows Issue
« on: October 15, 2015, 05:50:05 pm »
That code snippet worked really well in the demo at http://paramquery.com/pro/demos/group_rows. However, when plugged into my test code, I get a javascript error:
 
Object doesn't support property or method 'one'

It complains about this line of code: this.one("refresh", function().  I get the same error for the other "this.foobar" lines as well.

After alot of debugging, I discovered that on line 98 of the demo above uses this to create the grid: var grid = pq.grid("#grid_group_rows", obj); . The problem here is I try to use that same line of code and I get a javascript error that "pq" is undefined. The documentation at http://paramquery.com/pro/tutorial#topic-firstgrid says that I can use that optionally. I'm abit confused.  ???

Now, it gets even more interesting. on line 98 of the demo, I change that line to  var grid = $("#grid_group_rows").pqGrid( obj ); and run it. The demo doesn't work and indicates that there are no rows to display.

I noticed that using the "pq.grid" code on that demo, I briefly see the same display before it renders the rows and groupings. So, I suspect that something is happening prior to the grouping process.

I created a jsfiddle page to test this out and get the same results including not being able to use "pq.grid". http://jsfiddle.net/a49tds2b/3/ Interestingly on the jsfiddle example, "load" never fires.....only "create"/

I am presenting this awesome product on Monday/Tuesday for my company as a candidate to replace another grid product. We use grouped grids in quite a few places and require the initial load to have all rows collapsed as well as the column widths dynamically adjusted for the data fed into them. As I said, the code snippet you provided works great in the demo. I am hoping for a workaround or a fix to get this working before then.  :D

Regards,
Steve


9
ParamQuery Pro Evaluation Support / Collapsing Group Rows Issue
« on: October 15, 2015, 12:17:10 am »
Greetings,

I am trying to find a way to have all group grid rows collapse upon load....AND adjust the column widths to fit the data.

When I set the gridModel option "collapsed" to true, the columns are minimized to fit only the header cell content. When expanding the grouped rows, the data of course is pretty much useless and all scrunched up.

Setting that option to false results in everything being expanded, but everything looks great.

I have tried to collapse the grouped rows on all the events I could find in the API including load, create, and render. In all of those cases, the grouped rows do not finish before those events are fired. So, I cannot find a way to collapse those rows once the grid is truly finished rendering when a groupModel is used.

Any tips or tricks? And for reference, I am using remote data.

Sincerely,
Steve

10
ParamQuery Pro Evaluation Support / Re: Customizing Pager Bar?
« on: October 05, 2015, 07:42:42 pm »
Thanks for the reply.

As it turns out, this is pretty easy to do after all and it remains the same after a refresh (unlike the current grid tool we are using). For anybody interested, here is what I did to customize it. I added some jQuery code in the grid initialization to invoke after the "create" event:

Code: [Select]
create:function( event, ui ) {
                var part1 = '<span class="pq-ui-button ui-widget-header" tabindex="0" rel="tooltip" title="';
var part2 = '"><span class="ui-icon ';
var part3 = '"></span></span>';
$(".pq-grid-footer").prepend('<span class="pq-separator"></span>');
$(".pq-grid-footer").prepend(part1 + "New Window" + part2 + "ui-icon-newwin" + part3);
$(".pq-grid-footer").prepend(part1 + "Save As PDF" + part2 + "ui-icon-disk" + part3);
$(".pq-grid-footer").prepend($(".pq-grid-footer .pq-ui-button[title='Refresh']"));
$(".pq-grid-footer").prepend(part1 + "Customize Search" + part2 + "ui-icon-wrench" + part3);
$(".pq-grid-footer .pq-ui-button[title='Last Page'] ~ .pq-separator, pq-page-placeholder").remove();
       }


I have attached a screenshot from my test environment.

11
ParamQuery Pro Evaluation Support / Customizing Pager Bar?
« on: October 02, 2015, 10:32:23 am »
Just recently started using ParamQuery Pro, so I have been pouring over the extensive documentation and demos. However, I'm not clear on the best way to customize the pager bar. I am wanting to move a couple of things around like the refresh icon, records per page, add a couple of icons that fire off other processes, etc.

I have considered writing some jQuery and move the stuff around and add the stuff I need. I wanted to see if there was a better way to do this that I may have overlooked.

Can anybody point me in the right direction here?

Thanks,
Steve

12
Help for ParamQuery Grid (free version) / Customizing Pager Bar?
« on: October 02, 2015, 10:28:30 am »
Just recently started using ParamQuery Pro, so I have been pouring over the extensive documentation and demos. However, I'm not clear on the best way to customize the pager bar. I am wanting to move a couple of things around like the refresh icon, records per page, add a couple of icons that fire off other processes, etc.

I have considered writing some jQuery and move the stuff around and add the stuff I need. I wanted to see if there was a better way to do this that I may have overlooked.

Can anybody point me in the right direction here?

Thanks,
Steve

Pages: [1]