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

Pages: [1]
1
I totally agree with you, but unfortunately it's a requirement we have. The page have to work without JS and then show a basic table instead. Because of that everything has to be built in an html-table and then if possible converted to a grid for those users that has javascript enabled.
Your example on how to convert a table to a grid is good, but the grid doesn't have remote paging, filtering and all the other nice features of a grid.
I think it will create a lot of extra work for us, but I just wanted to know if it's something you've encountered before.

2
Is it possible to have a HTML-table and convert it to a grid and still have all the remote functionality? That includes paging, sorting and filtering the grid. I can't find any such demo, only the one about converting a table to a grid and then use local paging in it.

3
ParamQuery Pro Evaluation Support / Re: DateTime problem
« on: September 29, 2014, 07:57:58 pm »
That worked! Thanks!

Is this the only way to do it? Lets say if we have a huge system with hundreds of grids connected to hundreds of classes, we would have to do a custom converter for every class? I've used other grids in the past, but never encountered this behavior before. Still, I like this grid and it's not a breaking point, just would be great to have something like this built into the grid :D

4
ParamQuery Pro Evaluation Support / DateTime problem
« on: September 29, 2014, 12:43:36 pm »
Found another problem that I haven't been able to solve yet.
I have a list of objects that contains

Code: [Select]
public DateTime StartDate { get; set; }
Then I used your example code to the list back from MVC

Code: [Select]
StringBuilder sb = new StringBuilder(@"{""totalRecords"":" + total_Records + @",""curPage"":" + pq_curPage + @",""data"":");

JavaScriptSerializer js = new JavaScriptSerializer();

String json = js.Serialize(orders);
sb.Append(json);
sb.Append("}");

return this.Content(sb.ToString(), "text/text");

In the grid I added a column with these settings

Code: [Select]
title: "Start Date", minWidth: "190", dataIndx: "StartDate", dataType: "date"
When I view the page, instead of getting the date I get the serialized version

Code: [Select]
/Date(1288566000000)/
Any idea why? How can get the deserialized date?

5
Thanks for a very quick answer!

I updated my dataModel like this:

Code: [Select]
var dataModel = {
            location: "remote",
            sorting: "remote",
            dataType: "JSON",
            method: "GET",
            url: "Home/GetValues",
            getData: function (dataJSON) {
                var data = dataJSON.data;
                return { curPage: dataJSON.curPage, totalRecords: dataJSON.totalRecords, data: data };
            },
            postData: { advancedQueryId: 0 }
        }

The action in the controller got an extra parameter:
Code: [Select]
public ActionResult GetValues(int pq_curPage, int pq_rPP, string pq_sort, string pq_filter, int advancedQueryId)
Then I used a dropdown to change the value and search.

Code: [Select]
$(document).on('change', '#AdvancedQuerySelector', function (e) {
            e.preventDefault();

            var x = $(this).val();
            $("#testGrid").pqGrid("option", "dataModel.postData", function (ui) {
                return { advancedQueryId: x };
            });

            $("#testGrid").pqGrid("refreshDataAndView");       
        });


That worked very well! Now I nearly done all the quick checks if it's possible for us to use this and it looks very good :)

6
I'm evaluating the pro grid for the company I work for and we have a big requirement that I haven't been able to solve yet.
On most of our pages where we have the grids we also have the functionality to build more complex search filters. This is not part of the grid and is handles completely seperated. However, we want to be able to send along an id (stored in a hidden field) whenever you do a filtering in the grid.

Our code is done in MVC and the filtering is done via JSON remotely.
I've managed to get the grid to call this function:

Code: [Select]
public ActionResult GetValues(int pq_curPage, int pq_rPP, string pq_sort, string pq_filter) 

It returns the result correctly.

This is my testgrid so far:

Code: [Select]
$(function () {
        function pqDatePicker(ui) {
            var $this = $(this);
            $this
                .css({ zIndex: 3, position: "relative" })
                .datepicker({
                    yearRange: "-20:+0", //20 years prior to present.
                    changeYear: true,
                    changeMonth: true,
                    showButtonPanel: true,
                    onClose: function (evt, ui) {
                        $(this).focus();
                    }
                });
            //default From date
            $this.filter(".pq-from").datepicker("option", "defaultDate", new Date("01/01/1996"));
            //default To date
            $this.filter(".pq-to").datepicker("option", "defaultDate", new Date("12/31/1998"));
        }

        var dataModel = {
            location: "remote",
            sorting: "remote",
            dataType: "JSON",
            method: "GET",
            url: "Home/GetValues",
            getData: function (dataJSON) {
                var data = dataJSON.data;
                return { curPage: dataJSON.curPage, totalRecords: dataJSON.totalRecords, data: data };
            }
        }

        var obj = {
            flexWidth: true,
            editable: false,
            title: "ParamQuery Test Grid",
            pageModel: { type: "remote", rPP: 10, strRpp: "{0}" },
            filterModel: { on: true, mode: "AND", header: true },
            dataModel: dataModel
        };
        obj.colModel = [
            {
                title: "First Name", width: 400, dataIndx: "FirstName",
                filter: { type: 'textbox', condition: 'begin', listeners: ['change'] }
            },
               {
                   title: "Last Name", width: 400, dataIndx: "LastName",
                   filter: { type: 'textbox', condition: 'begin', listeners: ['change'] }
               },
               {
                   title: "Age", width: 50, dataIndx: "Age",
                   filter: { type: 'textbox', condition: 'begin', listeners: ['change'] }
               },
               {
                   title: "Start Date", width: 100, dataIndx: "StartDate",
                   filter: { type: 'textbox', condition: "between", init: pqDatePicker, listeners: ['change'] }
               },
               {
                   title: "Male", width: 100, dataIndx: "IsMale", dataType: "bool", align: "center",
                   filter: { type: "checkbox", subtype: 'triple', condition: "equal", listeners: ['click'] }
               },
               {
                   title: "Department", width: 100, dataIndx: "Department",
                   filter: {
                       type: "select",
                       condition: 'equal',
                       prepend: { '': '--Select--' },
                       valueIndx: "DepartmentId",
                       labelIndx: "Department",
                       listeners: ['change']
                   }
               }
        ];
        $("#testGrid").pqGrid(obj);

    });

So, how would I send along an extra parameter when filtering?

Pages: [1]