zGrid: Best PHP/AJAX Grid System. Good for Newbie web developers
Few days ago I have developed a Grid system using PHP, jQuery and Ajax. I want to share this with my dear users. It is not very well parametrized or generic but if have little much understanding of jQuery and Ajax then its easy to use. Give your feed back about zGrid.
Table Structure
CREATE TABLE `users` ( `id` int(11) NOT NULL auto_increment, `name` varchar(150) NOT NULL, `email` varchar(255) NOT NULL, `status` tinyint(1) NOT NULL, `orders` int(11) NOT NULL, PRIMARY KEY (`id`) )
Javascript Functions
var targetUrl = "listing.php"; // show all records // update status function update_status(id) { if (document.getElementById(id).checked == false) var status = 0; else var status = 1; $("#message").text(''); var id = id.replace('active_',''); $.ajax({ type: 'post', url: 'update_status.php', data: 'id='+id+"&status="+status, beforeSend: function(){ $("#loader-"+id).show(); }, success: function(e){ $("#loader-"+id).hide(); if(e==1) $("#message").append("<span>Status has been activated.</span>"); else $("#message").append("<span>Status has been inactivated.</span>"); } }); } // update order $(document).ready(function(){ $('#sortable').sortable({ update: function(event, ui) { var itemOrder = $(this).sortable('toArray').toString(); $.get('update_order.php', {itemOrder:itemOrder}); } }); }); $(document).ready(function(){ /// first time record var content = $("#sortable"); // main content ul //content.load(targetUrl); // delete record $('a#delete').livequery('click', function(e) { if(confirm('Are you sure you want to delete this record?')==false) return false; e.preventDefault(); var parent = $(this).parent(); var temp = parent.attr('id').replace('delete-',''); var main_tr = $('#id-'+temp); $.ajax({ type: 'get', url: 'delete.php?id='+ parent.attr('id').replace('delete-',''), data: '', beforeSend: function(){ }, success: function(){ main_tr.fadeOut(700,function(){ main_tr.remove(); }); } }); }); // sorting records $('.hover').click(function(){ var content = $("#sortable"); // main content ul content.load(targetUrl+'?sort='+$(this).html()); $('.hover').css('background-color',''); $(this).css('background-color','#99CC99'); }); }); // formValidation function validateFrm(formType) { if($('#email').val().length < 1 || $('#name').val().length < 1){ alert('Please fill the required field.'); } else { var formParam = $("#customForm").serialize(); if(formType == 'add') { var file = 'add_record.php'; var message = 'Record Added !'; } else { var file = 'update_record.php'; var message = 'Record Updated !'; } $.post(file+"?"+formParam,{ }, function(response){ get_result = response; if(response == 1) { $('#faceBoxmessage').fadeOut(); $('#faceBoxmessage').html(unescape(message)); $('#faceBoxmessage').fadeIn(); setTimeout(" $.facebox.close();",1000) ////////////// var content = $("#sortable"); // main content ul content.load(targetUrl); $('.hover').css('background-color',''); } }); } }
Who I Am

Zeeshan Rasool
Software Engineer - PHP
Lahore - Pakistan
zeeshan(@)99points.info
Skype: zeeshan-rasool
gTalk: zishan.rasool85
Categories
- AJAX (37)
- Codeigniter (16)
- CSS (16)
- Facebook (11)
- Joomla (1)
- JQuery (53)
- Miscellaneous (4)
- Mootools (1)
- MySQL (6)
- PHP (60)
- SEO (2)
- Technology (6)
- Tutorials (15)
- Twitter (2)
- Web Design (23)
- Web Development (57)
- WordPress (2)
Tags
99points
adobe
AJAX
ajax pagination
ajax rating
ajax tutorial
ajax voting system
captcha
Codeigniter
codeigniter 2.0
codeigniter recaptcha
CSS
css tutorials
dreamweaver cs5
Facebook
facebox
farmville
ffmpeg
flv
google api
hacking
Joomla
JQuery
JQuery Gallery
JQuery menus
Jquery tutorial
mafia war
Mootools
MySQL
pagination
Payment
PHP
php curl
recaptcha
RSS Feed
SEO
simplepie
socail networking
ssl
Tutorials
Twitter
wall script
Web
XSS
youtube
Comments
- rajunix on Wall Script in Facebook and Google+ Style
- gian on Best: Facebook Style Profile Edit script using jQuery, Ajax and PHP.
- ZeeShaN on Wall Script in Facebook and Google+ Style
- ZeeShaN on Wall Script in Facebook and Google+ Style
- Ahmed on YouTube Style Rating/Voting System using jQuery, Ajax and PHP. Ever Best Tutorial !
ZeeShaN







Thanks Andreja, Yes you can do this but thats a change in code so you would need to update code in js and as well as in php.
Great plugin! Thank you! I have just one question. Is there way to create two columns in databse with status function ( for example status and status2). Thank you in advance for your help! Once more, great work!!!
Hi Shon,
yes it is, Actually this is not a plugin which you could do only providing few parameters but It is just a builtin script for those who need something like this.
Too much JS code. JS sucks for grids. Too many demands on the client to operate efficiently.
Hi,
Excellent !
Files are updated now, sorry for delay
Can anybody send me to e-mail this script i cannot download this script link dosent working
my e-mail: teymur.oqtayoglu@gmail.com =*** <3
Please, send this script to my email adress. This file removed from site.
please email me your script too, your script very nice… i cannot download it. thks b4
Could you please email me the script too, i really like it… i cannot download it.
Thank you,
Alex