Welcome Guest, Not a member yet? Register   Sign In
Flexigrid - Lightweight but rich data grid

[eluser]Synergiq[/eluser]
The problem with the asp code was my fault, an extra comma.

There is an asp version for flexigrid that works in IE here: http://jamesowers.co.uk/asp-tutorials/63...version-2/

[eluser]Roberto Miguez[/eluser]
I got the code but now I got other error. The search doesn't work. I receive the answer "Processing, please wait..." but nothing happens and I need to refresh the page to continue to use. Could someone help me? Thank you.

[eluser]Synergiq[/eluser]
Its probably a mistake in my code somewhere. I'll have a look.

[eluser]Synergiq[/eluser]
I've fixed that problem now, just re-download the rar file.

[eluser]Roberto Miguez[/eluser]
Thank you Synergiq, now it is working perfectly!

[eluser]Roberto Miguez[/eluser]
Is there any possibility to use the structure A instead the structure B as follows?

Structure A:
Code:
url: 'test.asp',
dataType: 'json',
colModel : 'testStructure.asp'
...

Where testStructure.asp will generate the following code:

Code:
[
{display: 'ID', name : 'id', width : 50, sortable : true, align: 'left'},
{display: 'First Name', name : 'firstname', width : 100, sortable : true, align: 'left'},
{display: 'Last Name', name : 'lastname', width : 100, sortable : true, align: 'left'},
{display: 'Color', name : 'color', width : 100, sortable : true, align: 'left'},
{display: 'Height', name : 'height', width : 100, sortable : true, align: 'left'}    
...

Structure B:
Code:
url: 'test.asp',
dataType: 'json',
colModel : [
{display: 'ID', name : 'id', width : 50, sortable : true, align: 'left'},
{display: 'First Name', name : 'firstname', width : 100, sortable : true, align: 'left'},
{display: 'Last Name', name : 'lastname', width : 100, sortable : true, align: 'left'},
{display: 'Color', name : 'color', width : 100, sortable : true, align: 'left'},
{display: 'Height', name : 'height', width : 100, sortable : true, align: 'left'}    
...

[eluser]noon[/eluser]
No I wouldn't think so Roberto. flexigrid isn't set up to open an ajax communication on the col model.

I have a problem with my attempt at this, it never displays any data (doesnt throw an error in console either, just "Processing.."). Here's my output:

Code:
{
page: 1,
total: 258,
rows: [
{id:'0913', cell:['0913','Accelrys, Inc.','Stockholding','BHC']},
{id:'0913', cell:['0913','Accelrys, Inc.','Stockholding','BHC']},
{id:'0913', cell:['0913','Accelrys, Inc.','Stockholding','BHC']},
{id:'0913', cell:['0913','Accelrys, Inc.','Stockholding','BHC']},
{id:'1622', cell:['1622','Aerovance, Inc.','Stockholding','BHC']},
{id:'2203', cell:['2203','Anthra Pharmaceuticals, Inc.','Stockholding','BHC']},
{id:'None', cell:['None','Arch Foundation (NON-PROFIT)','Entity','BHC']},
{id:'1214', cell:['1214','Avigen, Inc.','Stockholding','BHC']},
{id:'1214', cell:['1214','Avigen, Inc.','Stockholding','BHC']},
{id:'1214', cell:['1214','Avigen, Inc.','Stockholding','BHC']}
]}

Here's my JS:
Code:
$("#advanced").flexigrid({
        url: 'get.cfm',
        dataType: 'json',
        colModel : [
            {display: 'Company Number', name : 'co_num', width : 40, sortable : true, align: 'left'},
            {display: 'Company Name', name : 'co_name', width : 180, sortable : true, align: 'left'},
            {display: 'Type', name : 'type', width : 50, sortable : true, align: 'left'},
            {display: 'TK/Subgroup', name : 'tk', width : 130, sortable : true, align: 'left'}
        ],
        buttons : [
            {name: 'Add', bclass: 'add'},
            {name: 'Delete', bclass: 'delete'},
            {separator: true}
        ],
        searchitems : [
            {display: 'Company Name', name : 'co_name', isdefault: true},
            {display: 'TK/Subgroup', name : 'tk'}
        ],
        sortname: "co_name",
        sortorder: "asc",
        usepager: true,
        title: 'Countries',
        useRp: true,
        rp: 10,
        showTableToggleBtn: true,
        width: 700,
        height: 200
    });

Help please Sad I've tried both with a content-header and without (some people have used it I have seen, and others haven't) I'm not sending any other header data such as expiration,modified,cache,pragma.

EDIT: I have a working PHP version, but my ColdFusion one wont. I removed all the header info from my PHP script and it still works on that version. Im confused Sad

EDIT2: I have no idea what I changed but it works now.

[eluser]Roberto Miguez[/eluser]
noon,

Well, I am looking forward to retrieve the data model dynamically as we do with the data.

Is there any way to do it?

[eluser]slothy[/eluser]
[quote author="paulopmx" date="1208926266"][quote author="slothy" date="1208888235"]Me again Paulo...

same with using a Search tool on a table with multiple tables on page :-S

The search tool behaviour (ie opening and closing) is duplicated in other tables

Same fix as before i guess... just need to hard-wire referencing[/quote]

Thanks again slothy. just change this
Code:
$('.pSearch',g.spDiv)

to this
Code:
$('.pSearch',g.pDiv)
[/quote]

Yeaah, i found it wasnt difficult to find with a trace

Wish all debugging was as easy as this Paulo Big Grin

A caveat for other users :-

ALWAYS USE FIREBUG !! WIll make your lives a lot easier and lower your dependency on caffeine!!!!

[eluser]noon[/eluser]
[quote author="Roberto Miguez" date="1209145257"]noon,

Well, I am looking forward to retrieve the data model dynamically as we do with the data.

Is there any way to do it?[/quote]

I'm pretty certain that you can. I'm sort of new to jQuery though. In traditional javascript I would open an ajax request to the page, store the responseText in a strnig variable. And set your colModel using an eval. Not sure how to mix traditional javascript variables with jQuery quite yet.




Theme © iAndrew 2016 - Forum software by © MyBB