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

[eluser]paulopmx[/eluser]
[quote author="davgino" date="1207314237"][quote author="paulopmx" date="1207274961"][quote author="davgino" date="1207273538"]Hi,
How i find id of row?[/quote]

is it the selected row? or any row.[/quote]

at both of them: the id of the selected row and array of the id's selected.[/quote]

The id of the data is stored as id of the row it self with the format "row"+id;

ok say you want to get the id of a selected row from a table with class 'flexme'

Code:
$('.flexme tr.trSelected').each
(
    function ()
    {
   rowid = this.id.substring(3);
   //use row id data here
   }
);

of course if you want to just get all just remove the word 'trSelected' in the jQuery Selector.
#72

[eluser]Kevin Kietel[/eluser]
[quote author="wish_bear" date="1207309464"]@@Kevin Kietel

Quote:I’m trying to add functionality to the ‘delete button’. I post an array with item id’s by using Ajax. Selected items will be deleted. How do I call the ‘reload’ function after successful Ajax results?

Can you help me how did you implement the Delete Functionality? I am only a Beginner in Ajax and JQuery.

Thanks in advance dude.[/quote]

@whish_bear:

I've put up a small example, you can find it on http://sanderkorvemaker.nl/test/flexigrid/, together with a complete zipfile (including the plugin, php pages and MySQL database dump).

If you need more help, just ask!
#73

[eluser]Synergiq[/eluser]
Hi, I think your script is fantastic but I'm a bit stuck.

I've got pretty much the whole thing working using classic asp (coming from a Sybase database) but I'm stuck on the pagination. I cant figure out why the page number always goes back to one (the number in the input field). This means that you cant use the next and back buttons to get past page 2.

Thanks for your help.
#74

[eluser]paulopmx[/eluser]
[quote author="Synergiq" date="1207334629"]Hi, I think your script is fantastic but I'm a bit stuck.

I've got pretty much the whole thing working using classic asp (coming from a Sybase database) but I'm stuck on the pagination. I cant figure out why the page number always goes back to one (the number in the input field). This means that you cant use the next and back buttons to get past page 2.

Thanks for your help.[/quote]

Can you post your asp code here?
#75

[eluser]Synergiq[/eluser]
Here's the asp code for the page that generates the json:
(I should also point out, there's no LIMIT command in sybase so I've had to do some of the code slightly differently)

(I've removed this code for now. I'm working on a tutorial for using flexigrid with asp)
#76

[eluser]paulopmx[/eluser]
Synergiq, a simple change will fix it. assign the page variable to the json page variable.

Code:
%>
{
page: <%=page%>,
total: <%=cstr(total)%>,
rows: [
<%
RecordsetXML.Move start
do until RecordsetXML.eof
%>
{id:'<%=(RecordsetXML.Fields.Item("contact_id").Value)%>', cell:['<%=(RecordsetXML.Fields.Item("contact_id").Value)%>', '<%=(RecordsetXML.Fields.Item("contact_firstname").Value)%>','<%=(RecordsetXML.Fields.Item("contact_secondname").Value)%>','<%=(RecordsetXML.Fields.Item("contact_street").Value)%>']},
<%    
RecordsetXML.movenext
loop

%>
]}

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

[eluser]Synergiq[/eluser]
Thanks, I cant believe I missed that!

and thanks for pointing me to this site, I'll definatley be using CodeIgniter on my next PHP application Big Grin
#78

[eluser]Unknown[/eluser]
Hi,

For anyone who wants to use Flexigrid with Ruby on Rails 2.0, I just posted a <a href="http://www.nickfessel.com/index.php?post=17">tutorial on how to put Flexigrid on Rails</a>.

Nick J. Fessel
nfessel (at) gmail (dot) com
#79

[eluser]Armorfist[/eluser]
Is there a way to make a button that selects/deselects all items on the screen?
#80

[eluser]Armorfist[/eluser]
I just started to work with jquery so this may not be the best solution. To select/deselect all items on screen i used the following method:

I added 2 buttons to the grid, 'Select All' and 'DeSelect All' that call the 'test' function:
Code:
buttons : [
{name: 'Add', bclass: 'add', onpress : test},
{name: 'Delete', bclass: 'delete', onpress : test},
{name: 'Select All', bclass: 'add', onpress : test},
{name: 'DeSelect All', bclass: 'delete', onpress : test},
{separator: true}
],

Then added the following code to the 'test' function:

Code:
if (com=='Select All')
{
$('.bDiv tbody tr',grid).addClass('trSelected');
}
    
if (com=='DeSelect All')
{
$('.bDiv tbody tr',grid).removeClass('trSelected');
}

Is there a better way to do this?




Theme © iAndrew 2016 - Forum software by © MyBB