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

[eluser]paulopmx[/eluser]
[quote author="Xiomay" date="1208380778"]Hi people,

i have a simple question actually. I want to swap some columns not with drag and drop but with a script function.
Can i access the method switchCol(x,y) in the flexigrid with javascript ?
like this one?

Code:
$.fn.switchX = function(p,p1){ //create a new method to access switchCol
        
        alert(p+" p1);
        
        return this.switchCol(p,p1);
}

and then with a href i would like to operate the switchX(x,y) method.
like this:
Code:
<a href="[removed]$('#table-2').switchX(7,5);">Swap Columns</a>

thanks a lot![/quote]

Hi Xiomay this will be highly experimental and untested, but you maybe able to access the grid API directly like so:
Code:
var flex = $('#flex1').flexigrid({ parameters set here });
flex.grid.switchCol(1,2);

Hope it works out.

[eluser]paulopmx[/eluser]
[quote author="davgino" date="1208283021"][quote author="paulopmx" date="1208149431"][quote author="davgino" date="1208003435"]Hi Paulo
When new next realese ??
David O.[/quote]

Hi David,

Ok i'm putting a nail on my schedule to make it stick :-).

I'm planning to make a new release on the 28th of April.

I'm still addressing some of the concerns and request that I was made aware of. So if anyone has any last minute request, let me know.

Paulo[/quote]
1.Maybe you succeeded in createing a new method for adding a new row ?
2.Did you succeed in adding an Editable rows features ?
Pls let me know.[/quote]

Hi davigno,

1. Not yet.
2. Also not yet, it might not be until 1.5. But i believe someone in this forum was able to use jEditable successfully.

[eluser]paulopmx[/eluser]
[quote author="zebrahat" date="1208317541"][quote author="paulopmx" date="1208149431"]

Ok i'm putting a nail on my schedule to make it stick :-).

I'm planning to make a new release on the 28th of April.

I'm still addressing some of the concerns and request that I was made aware of. So if anyone has any last minute request, let me know.

Paulo[/quote]

Would it be possible to create "locked columns"? i.e. columns on the left that do not scroll as you scroll the rest of the dataset horizontally.

That would be awesome! Not that your grid isn't already awesome. It is![/quote]

Hi zebrahat,

I think that would be cool too, but thats a lot of work on my already full schedule. I will think about it and maybe add it to a roadmap. But for reference sake, I believe another grid framework is already doing this.

[eluser]paulopmx[/eluser]
[quote author="Synergiq" date="1207943044"]I've just noticed when I run it in ie7 I get an error saying Line: 403 'id is null or not an object'.

Any idea what would cause this?[/quote]

Hi synergiq,

I answered this question here : http://ellislab.com/forums/viewreply/385467/

[eluser]paulopmx[/eluser]
[quote author="Kevin Kietel" date="1208276649"][quote author="paulopmx" date="1208149431"][quote author="davgino" date="1208003435"]Hi Paulo
When new next realese ??
David O.[/quote]

Hi David,

Ok i'm putting a nail on my schedule to make it stick :-).

I'm planning to make a new release on the 28th of April.

I'm still addressing some of the concerns and request that I was made aware of. So if anyone has any last minute request, let me know.

Paulo[/quote]

So if anyone has any last minute request, let me know. >>>>
how about something like this??
http://www.isocra.com/2008/02/table-drag...ry-plugin/
(I've tried to get it running, but no success..... :-S )[/quote]

Hi Kevin,

That's cool Kevin, I will test this if its feasible in my schedule.

[eluser]Balaji ASP[/eluser]
[quote author="paulopmx" date="1208402076"][quote author="Balaji ASP" date="1208373956"]Nice, very nice. Thx my friend...!!

i used this query for my applications it's works good...

I’ve just noticed when I run it in ie7

server 2003:
I get an error saying Line: 402 ‘id is null or not an object’.

xp:
I get an error saying Line: 403 ‘id is null or not an object’.

here is the link
http://synergiq.co.uk/test/flexigrid/

plz help me my friend... ASAP...[/quote]

Hi Balaji,

Here is your problem at the last part of asp file that generates the JSON FILE

Code:
{id:'245', cell:['245', 'collin','sharples','green','200','sleepy','70','female','76 water terrace','15 rue des begognas','76 water terrace','45 rue de la liberte','london bridge (right under it)','Australia','Bourgogne','1']},
]}

as you can see there is a comma after "'Bourgogne','1']}" what happens is that IE is expecting another array object, but the truth is there isn't anymore. Firefox tries to fix this automatically, but IE requires you to fix it and follow proper array format.[/quote]

Thx Thx Thx my friend... for your valuable replay!! :-)

now it's working fine... in IE7,Mozilla and other browsers

here is the code i used with your suggestion

Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
&lt;!--#include File="INC_FILES/ADOVBS.INC"--&gt;
<%
set cnn = server.createobject("ADODB.Connection")
cnn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server;.MapPath("test")&".mdb;"

Set RecordsetXML = Server.CreateObject ("ADODB.Recordset")
    RecordsetXML.CursorType = adOpenDynamic
    RecordsetXML.CursorLocation = adUseClient
Set RecordsetXML2 = Server.CreateObject ("ADODB.Recordset")
    RecordsetXML2.CursorType = adOpenDynamic
    RecordsetXML2.CursorLocation = adUseClient    
'Page Numbers
Dim page
page = Request.Form("page")
if page = "" then
page = 1
End if

Dim rp
rp = Request.Form("rp")
if rp = "" then
rp = 15
End if

Dim start
start = ((page-1) * rp)
limit = " TOP "&page;*rp



'Search Bits
Dim searchterm
Dim sortname
if Request.Form("sortname") = "" then
sortname = "id"
Else
sortname = Request.Form("sortname")
End If

Dim sortorder
if Request.Form("sortorder") = "" then
sortorder = "desc"
Else
sortorder = Request.Form("sortorder")
End If

Dim sort

sort = " ORDER By "&sortname;&" "&sortorder;if Request.form("query") <> "" then
searchterm = Request.form("query")
searchcols = request.form("qtype")
if searchcols = "id" then
    if isnumeric(searchterm) then
    fullsearch = "WHERE "&searchcols;&" = "&searchterm;else
    fullsearch = ""
    end if
Else
    fullsearch = "WHERE "&searchcols;&" LIKE '%"&searchterm;&"%'"
End if
End if

'Main Query
Dim RecordsetXML
Dim RecordsetXML_cmd
Dim RecordsetXML_numRows

RecordsetXML_cmd = "SELECT "& limit &" * FROM person "&fullsearch;&""&sort;RecordsetXML.open RecordsetXML_cmd,cnn,3,3
RecordsetXML_numRows = 0

'Count Recordset
Dim RecordsetXML2
Dim RecordsetXML2_cmd
Dim RecordsetXML2_numRows

RecordsetXML2_cmd= "SELECT count(*) as countR FROM person"

RecordsetXML2.open RecordsetXML2_cmd,cnn,3,3
RecordsetXML2_numRows = 0

Dim total
Dim countRec
total = RecordsetXML2.Fields.Item("countR").Value

RecordsetXML2.Close()
Set RecordsetXML2 = Nothing


%>
{
page: <%=page%>,
total: <%=cstr(total)%>,
rows: [
<%
RecordsetXML.Move start

for i=start to RecordsetXML.recordcount-1
if i <> RecordsetXML.recordcount-1 then
%>
{id:'<%=(RecordsetXML.Fields.Item("id").Value)%>', cell:['<%=(RecordsetXML.Fields.Item("id").Value)%>', '<%=(RecordsetXML.Fields.Item("firstname").Value)%>','<%=(RecordsetXML.Fields.Item("lastname").Value)%>','<%=(RecordsetXML.Fields.Item("color").Value)%>','<%=(RecordsetXML.Fields.Item("height").Value)%>','<%=(RecordsetXML.Fields.Item("middlename").Value)%>','<%=(RecordsetXML.Fields.Item("age").Value)%>','<%=(RecordsetXML.Fields.Item("sex").Value)%>','<%=(RecordsetXML.Fields.Item("address1").Value)%>','<%=(RecordsetXML.Fields.Item("address2").Value)%>','<%=(RecordsetXML.Fields.Item("address3").Value)%>','<%=(RecordsetXML.Fields.Item("address4").Value)%>','<%=(RecordsetXML.Fields.Item("address5").Value)%>','<%=(RecordsetXML.Fields.Item("country").Value)%>','<%=(RecordsetXML.Fields.Item("region").Value)%>','<%=(RecordsetXML.Fields.Item("is_dead").Value)%>']},
<%else%>
{id:'<%=(RecordsetXML.Fields.Item("id").Value)%>', cell:['<%=(RecordsetXML.Fields.Item("id").Value)%>', '<%=(RecordsetXML.Fields.Item("firstname").Value)%>','<%=(RecordsetXML.Fields.Item("lastname").Value)%>','<%=(RecordsetXML.Fields.Item("color").Value)%>','<%=(RecordsetXML.Fields.Item("height").Value)%>','<%=(RecordsetXML.Fields.Item("middlename").Value)%>','<%=(RecordsetXML.Fields.Item("age").Value)%>','<%=(RecordsetXML.Fields.Item("sex").Value)%>','<%=(RecordsetXML.Fields.Item("address1").Value)%>','<%=(RecordsetXML.Fields.Item("address2").Value)%>','<%=(RecordsetXML.Fields.Item("address3").Value)%>','<%=(RecordsetXML.Fields.Item("address4").Value)%>','<%=(RecordsetXML.Fields.Item("address5").Value)%>','<%=(RecordsetXML.Fields.Item("country").Value)%>','<%=(RecordsetXML.Fields.Item("region").Value)%>','<%=(RecordsetXML.Fields.Item("is_dead").Value)%>']}
<%
end if
RecordsetXML.movenext
next
%>
]}

<%
RecordsetXML.Close()
Set RecordsetXML = Nothing
%>

Thx once again my friend...
:-)

[eluser]Xiomay[/eluser]
thanks for the quick reply but it unfortunately doesnt work.

what kind of parameters i should so set within this brackets?

Code:
var flex = $('#table-1').flexigrid({set parameters here});
shall put these codes in the flexigrid.js? or in my own js-script file?

and this code brings error:
Code:
flex.grid.switchCol(7,5);

this method
Code:
switchCol: function(cdrag,cdrop) { //switch columns
...
}

is to swap the columns table, am i right?

[eluser]Xiomay[/eluser]
[quote author="Xiomay" date="1208441282"]thanks for the quick reply but it unfortunately doesnt work.

what kind of parameters i should so set within this brackets?

Code:
var flex = $('#table-1').flexigrid({set parameters here});
shall put these codes in the flexigrid.js? or in my own js-script file?

and this code brings error:
Code:
flex.grid.switchCol(7,5);

this method
Code:
switchCol: function(cdrag,cdrop) { //switch columns
...
}

is to swap the columns table, am i right?[/quote]
Now i did it .. but i can only mov the <tbody>, the <thead> still remains at the same position Sad


its like this:
Code:
function swapCol(id){
    var flex = $('#'+id).flexigrid({});
    flex.moveColumn(1,9);
}
$.fn.moveColumn = function(c1,c2) { // function to test
     return this.each( function() {
     if (this.grid) this.grid.switchCol(c1,c2);
     });
}; //end test

[eluser]dah[/eluser]
[quote author="paulopmx" date="1208402339"][quote author="dah" date="1208387721"]Thanks! Flexigrid is great. I have been working with it for a while now. I added buttons across the top for each letter of the alphabet to allow users to quickly jump to that record set. Works well except for one issue I am working with...

it holds the page number when you click a new letter. So, if you were on page 3 of the records that start with "S" and then click the "A" record set, it starts on page 3 of the "A" set. Get it? I wish I could just show you but currently all the code is behind the firewall. Soon tho.

Any ideas on how to reset that page when I click a new letter sorting option?

Thanks again for the great code![/quote]

Hi dah,

Yes you just set the new page in the parameters before reloading flexigrid like so:
Code:
$('#flex1').flexOptions({newp:1});

Have fun.[/quote]

Code:
function sortAlpha(com)
                        {
                        $('#flex1').flexOptions({newp:1, params:[{name:'letter_pressed', value: com}]});
                        $("#flex1").flexReload();
                        }

that seemed to do it!

[eluser]paulopmx[/eluser]
[quote author="Xiomay" date="1208458167"][quote author="Xiomay" date="1208441282"]thanks for the quick reply but it unfortunately doesnt work.

what kind of parameters i should so set within this brackets?

Code:
var flex = $('#table-1').flexigrid({set parameters here});
shall put these codes in the flexigrid.js? or in my own js-script file?

and this code brings error:
Code:
flex.grid.switchCol(7,5);

this method
Code:
switchCol: function(cdrag,cdrop) { //switch columns
...
}

is to swap the columns table, am i right?[/quote]
Now i did it .. but i can only mov the <tbody>, the <thead> still remains at the same position Sad


its like this:
Code:
function swapCol(id){
    var flex = $('#'+id).flexigrid({});
    flex.moveColumn(1,9);
}
$.fn.moveColumn = function(c1,c2) { // function to test
     return this.each( function() {
     if (this.grid) this.grid.switchCol(c1,c2);
     });
}; //end test
[/quote]

Great Effort Xiomay! Try adding this:
Code:
$.fn.moveColumn = function(c1,c2) { // function to test
     return this.each( function() {

                            if (c1>c2)
                                $('th:eq('+c2+')',this.grid.hDiv).before($('th:eq('+c1+')',this.grid.hDiv));
                            else
                                $('th:eq('+c2+')',this.grid.hDiv).after($('th:eq('+c1+')',this.grid.hDiv));
                            

     if (this.grid) this.grid.switchCol(c1,c2);
     });
};




Theme © iAndrew 2016 - Forum software by © MyBB