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

[eluser]ecarsted[/eluser]
Hi Paulo,

Two features that would be really nice to have:

1) Pass the a list of columns and the table name to the service.

2) The table able to process the results of a standard json_encode.


Using the $this->rest->jsonEndode($row); returns

{"id":"18","Emp_Id":"23","First_Name":"Bradley","Last_Name":"","Phone_Number":"","Cell_Phone":"","Email"
:""}

vs me having to code the specifics for each table to return the result

{id:'18',cell:['23','Bradley','','','','']}

Would make the server code much cleaner, and more importantly Smile Generic. I would only have to code one service. Add a request option to read, update, delete, and wow, you got a powerful tool!

Eric

[eluser]davgino[/eluser]
Hi Paulo

I realized a problem in flexigrid.

If i have more columns and i want to show or hide columns and if the height of grid is a little bit small , the last columns don't appear.
See the following link: http://contaflux.ro/gestiune/module/flexigrid.php

[eluser]Synergiq[/eluser]
I've uploaded my asp version of the script which uses json and an access database.

http://jamesowers.co.uk/asp-tutorials/57...-with-asp/

[eluser]paulopmx[/eluser]
[quote author="ecarsted" date="1207578841"]Hi Paulo,

Two features that would be really nice to have:

1) Pass the a list of columns and the table name to the service.

2) The table able to process the results of a standard json_encode.


Using the $this->rest->jsonEndode($row); returns

{"id":"18","Emp_Id":"23","First_Name":"Bradley","Last_Name":"","Phone_Number":"","Cell_Phone":"","Email"
:""}

vs me having to code the specifics for each table to return the result

{id:'18',cell:['23','Bradley','','','','']}

Would make the server code much cleaner, and more importantly Smile Generic. I would only have to code one service. Add a request option to read, update, delete, and wow, you got a powerful tool!

Eric[/quote]

Hi Eric,

1. You can pass additional parameters to the service using this setting
Code:
param : {name:value}

So using this technique you can pass the table and fields that you want.

2. I will consider this, but the point of having my own standard format is to keep Flexigrid lightweight, because for sure a lot of people want to use other standards as well, and that's probably the strong point of ExtJS in which its so powerful you can adapt it to any backend format, the drawback of course is a heavier javascript and more complicated configuration. This is the opposite of Flexigrid, where the point is to make it lightweight as possible yet flexible enough to serve your needs, the only sticking point is you prepare the data it expects for it. In the future I might be able to open an API where you can create a javascript function that will interpret the data for Flexigrid.

[eluser]ecarsted[/eluser]
[quote author="paulopmx" date="1207593643"][quote author="ecarsted" date="1207578841"]Hi Paulo,

Two features that would be really nice to have:

1) Pass the a list of columns and the table name to the service.

2) The table able to process the results of a standard json_encode.

Hi Eric,

1. You can pass additional parameters to the service using this setting

Code:
param : {name:value}

So using this technique you can pass the table and fields that you want.

2. I will consider this, but the point of having my own standard format is to keep Flexigrid lightweight, because for sure a lot of people want to use other standards as well, and that's probably the strong point of ExtJS in which its so powerful you can adapt it to any backend format, the drawback of course is a heavier javascript and more complicated configuration. This is the opposite of Flexigrid, where the point is to make it lightweight as possible yet flexible enough to serve your needs, the only sticking point is you prepare the data it expects for it. In the future I might be able to open an API where you can create a javascript function that will interpret the data for Flexigrid.[/quote]

Thanks for the reply Paulo,

1) Duh, lol, already got to use this to pass the where string , I pass three WHERE parms.
2) I understand. Am making a quick flexgrid formatter.

$flexigridrow = fexiEncode(jsonEncode($row));

of course, the id will have to be the first value, and the order of the values will have to be in the correct order.

I will post it tonight.

Eric

[eluser]Armorfist[/eluser]
That would be great ecarsted, I was thinking of making a function with jsonEncode myself.

[eluser]Armorfist[/eluser]
[quote author="paulopmx" date="1207539117"]
Armorfist,

for the 'height:auto' problem, height:auto is really not meant to be used for dynamic data because it bases its height on the loaded elements.
[/quote]

Is it possible to add one element if no results are found like "No Records" or something? That would (i think) fix the auto height issue and the grid wouldn't be empty when no data is returned.
I want to use auto height because the browser window scroll is more fluid than the div scroll used in the grid.

Thanks

[eluser]ecarsted[/eluser]
[quote author="paulopmx" date="1207539304"]

You can actually do this already in the setting like so
Code:
url: 'get_data_from_db.php',
  sortname: "name",
  sortorder: "asc",
  param: "numcode > 100"  // more interesting when populated by php
[/quote]

Hi Paulo,

I am struggling with adding pramams.

I have tried
Code:
param:"where xxx",
wherestr:"where xxx",
param: {wherestr:"where xxx"},

and nothing gets added to the post ;(

what am I missing.

TY in advance,
Eric

[eluser]kolanos[/eluser]
[quote author="paulopmx" date="1207563487"]much better right?[/quote]
Yes, this worked great! Thanks again.

Looking forward to 1.1.

[eluser]ecarsted[/eluser]
Hi, Paulo

Looking at the code and stepping in with Firebug, (what a handy tool!),

I see that the correct thing to set is params, not param

Code:
if (p.params)
589 {
590 var nparam = {};
591 $.each(p.params, function() {
592 nparam[this.name] = this.value;
593 });
594 $.extend(param,nparam);
595 }
596

so now, I am setting

params: {wherestr:"where xxx"},

Thing is though, nparam is not being updated. Hmm, not sure how to fix it.

Eric

ps. Also, not sure how I would change this value on the fly based on user input in a set of form fields.




Theme © iAndrew 2016 - Forum software by © MyBB