Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > JavaScript > Bibliothèques & Frameworks > jQuery
jQuery Forum d'entraide sur le framework jQuery. Avant de poster : Tutoriels jQuery, FAQ jQuery, Tous les tutoriels JavaScript, Toutes les FAQ JavaScript
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 14/09/2011, 16h52   #1
Membre éclairé
 
Homme Gérard Okono
Développeur Web
Inscription : juillet 2006
Messages : 711
Détails du profil
Informations personnelles :
Nom : Homme Gérard Okono
Localisation : Cameroun

Informations professionnelles :
Activité : Développeur Web
Secteur : Administration - Collectivité locale

Informations forums :
Inscription : juillet 2006
Messages : 711
Points : 328
Points : 328
Par défaut Tableaux dynamiques et pagination

Bonjour,
Code :
1
2
3
4
5
6
7
8
9
10
11
 
$.ajax({
    type: "POST",
    url: "test.php",
    data: "name=John&location=Boston",
    dataType: "json"
    success: function(msg){
        //Contitution et génération du tableau par jQuery...
	//Application du plugin qui permet de mettre en forme le tableau, le pagine en fonction du nombre de ses lignes
    }
});
Les données reçues (json) du rejour ajax sont fonction de data. Ce json étant très volumineux environs 2 millions d'items, je souhaite un plugin jquery me permettant de :
  • mettre en forme mon tableau
  • paginer le tableau
  • faire des recherches sur les colonnes si possible

Merci d'avance...
okoweb est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 15/09/2011, 10h13   #2
Rédacteur/Modérateur
 
Avatar de SpaceFrog
 
Homme
Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Analyste Programmeur
Inscription : mars 2002
Messages : 30 040
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : Royaume-Uni

Informations professionnelles :
Activité : Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Analyste Programmeur
Secteur : Industrie

Informations forums :
Inscription : mars 2002
Messages : 30 040
Points : 45 141
Points : 45 141
jette a oeil sur ce plugin
http://www.trirand.com/blog/
__________________
Ma page Developpez
Président du CCMPTP (Comité Contre le Mot "Problème" dans les Titres de Posts)
Deux règles du succès: 1) Ne communiquez jamais à quelqu'un tout votre savoir...
Votre post est résolu ? Alors n'oubliez pas le Tag


réalisations :www.planet-languages.com|www.saftair.com| www.ouestisol.fr | www.sebemex.fr | www.extramiante.fr | www.sistac-alizay.fr | www.acoustishop.fr | www.litt.fr | www.ouestventil.fr
SpaceFrog est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 15/09/2011, 10h19   #3
Membre régulier
 
Étudiant
Inscription : octobre 2010
Messages : 92
Détails du profil
Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : octobre 2010
Messages : 92
Points : 78
Points : 78
Bonjour,

moi j'utilise le plugin tablesorter : http://tablesorter.com/docs/ et pour la pagination le plugin suivant : http://tablesorter.com/docs/example-pager.html

Voilà ;-)
zeclad01 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 15/09/2011, 11h47   #4
Membre éclairé
 
Homme Gérard Okono
Développeur Web
Inscription : juillet 2006
Messages : 711
Détails du profil
Informations personnelles :
Nom : Homme Gérard Okono
Localisation : Cameroun

Informations professionnelles :
Activité : Développeur Web
Secteur : Administration - Collectivité locale

Informations forums :
Inscription : juillet 2006
Messages : 711
Points : 328
Points : 328
Citation:
Envoyé par zeclad01 Voir le message
Bonjour,

moi j'utilise le plugin tablesorter : http://tablesorter.com/docs/ et pour la pagination le plugin suivant : http://tablesorter.com/docs/example-pager.html

Voilà ;-)
Sauf la recherche, il répond à 90%

Merci.
okoweb est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 15/09/2011, 12h25   #5
Membre éclairé
 
Homme Gérard Okono
Développeur Web
Inscription : juillet 2006
Messages : 711
Détails du profil
Informations personnelles :
Nom : Homme Gérard Okono
Localisation : Cameroun

Informations professionnelles :
Activité : Développeur Web
Secteur : Administration - Collectivité locale

Informations forums :
Inscription : juillet 2006
Messages : 711
Points : 328
Points : 328
Citation:
Envoyé par SpaceFrog Voir le message
jette a oeil sur ce plugin
http://www.trirand.com/blog/
Il m'a l'air de tout faire, mais il faut une bonne dose d'apprentissage.

Merci.
okoweb est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 15/09/2011, 14h28   #6
Membre régulier
 
Étudiant
Inscription : octobre 2010
Messages : 92
Détails du profil
Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : octobre 2010
Messages : 92
Points : 78
Points : 78
Citation:
Envoyé par okoweb Voir le message
Sauf la recherche, il répond à 90%

Merci.
Exact j'avais loupé cette précision.
zeclad01 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 15/09/2011, 17h41   #7
Membre éclairé
 
Homme Gérard Okono
Développeur Web
Inscription : juillet 2006
Messages : 711
Détails du profil
Informations personnelles :
Nom : Homme Gérard Okono
Localisation : Cameroun

Informations professionnelles :
Activité : Développeur Web
Secteur : Administration - Collectivité locale

Informations forums :
Inscription : juillet 2006
Messages : 711
Points : 328
Points : 328
Citation:
Envoyé par zeclad01 Voir le message
moi j'utilise le plugin tablesorter : http://tablesorter.com/docs/
Ca donne exact! J'ai un très grand tableau environ 100 000 lignes.

Citation:
Envoyé par zeclad01 Voir le message
et pour la pagination le plugin suivant : http://tablesorter.com/docs/example-pager.html
Ce n'est pas claire dans la doc la procédure à suivre...

Merci pour votre aide.
okoweb est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 16/09/2011, 15h11   #8
Membre éclairé
 
Homme Gérard Okono
Développeur Web
Inscription : juillet 2006
Messages : 711
Détails du profil
Informations personnelles :
Nom : Homme Gérard Okono
Localisation : Cameroun

Informations professionnelles :
Activité : Développeur Web
Secteur : Administration - Collectivité locale

Informations forums :
Inscription : juillet 2006
Messages : 711
Points : 328
Points : 328
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
 
var header = ['Noms', 'Prénoms', 'Sexe', 'Date de naissance', 'Matricule'];
$(document).ready(function(){ 	 
		$.ajax({
			type: "POST",
			url: "staff.php",
			data: null,
			dataType: "json",
			success: function(datas){
				$("body").prepend($('<table/>', {'id': "matable", 'class': "tablesorter"}));
				$('table').append($('<thead/>'));
				$('table').append($('<tfoot/>'));
				$('table').append($('<tbody/>'));
				$('table').children("thead,tfoot").append(function(){
  					var tr = $(this).append($('<tr/>'));
  					$.each(header, function(i, item) { 
  						tr.append($('<th/>', {html: item}));
  					});		
				});
				$('tbody').append(function(){
  					$(datas).each(function(i, item) { 
  						var tr = $('tbody').append($('<tr/>'));
  						tr.append($('<td/>', {html: item.nom}));
  						tr.append($('<td/>', {html: item.prenom}));
  						tr.append($('<td/>', {html: (item.sexe==1) ? 'Homme' : 'Femme'}));
  						tr.append($('<td/>', {html: item.date_naissance}));
  						tr.append($('<td/>', {html: item.matricule}));	
  						if(i==1000) return false;
  					});	
				});
				$("table").tablesorter( {sortList: [[0,0], [1,0]]} );
			}
		});
});
Le tableau est bien inseré dans la page mais
Code :
{sortList: [[0,0], [1,0]]}
ne s'exécute pas pour trier mon tableau.

Merci pour votre aide.
okoweb est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 20/09/2011, 16h18   #9
Membre régulier
 
Étudiant
Inscription : octobre 2010
Messages : 92
Détails du profil
Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : octobre 2010
Messages : 92
Points : 78
Points : 78
Citation:
Envoyé par okoweb Voir le message
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
 
var header = ['Noms', 'Prénoms', 'Sexe', 'Date de naissance', 'Matricule'];
$(document).ready(function(){ 	 
		$.ajax({
			type: "POST",
			url: "staff.php",
			data: null,
			dataType: "json",
			success: function(datas){
				$("body").prepend($('<table/>', {'id': "matable", 'class': "tablesorter"}));
				$('table').append($('<thead/>'));
				$('table').append($('<tfoot/>'));
				$('table').append($('<tbody/>'));
				$('table').children("thead,tfoot").append(function(){
  					var tr = $(this).append($('<tr/>'));
  					$.each(header, function(i, item) { 
  						tr.append($('<th/>', {html: item}));
  					});		
				});
				$('tbody').append(function(){
  					$(datas).each(function(i, item) { 
  						var tr = $('tbody').append($('<tr/>'));
  						tr.append($('<td/>', {html: item.nom}));
  						tr.append($('<td/>', {html: item.prenom}));
  						tr.append($('<td/>', {html: (item.sexe==1) ? 'Homme' : 'Femme'}));
  						tr.append($('<td/>', {html: item.date_naissance}));
  						tr.append($('<td/>', {html: item.matricule}));	
  						if(i==1000) return false;
  					});	
				});
				$("table").tablesorter( {sortList: [[0,0], [1,0]]} );
			}
		});
});
Le tableau est bien inseré dans la page mais
Code :
{sortList: [[0,0], [1,0]]}
ne s'exécute pas pour trier mon tableau.

Merci pour votre aide.
T'as essayé de trié colonne par colonne dans un premier temps ?
zeclad01 est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 01h54.


 
 
 
 
Partenaires

Hébergement Web