jQuery Bootgrid is a very popular grid plugin and specially designed for bootstrap. This tutorial help to add .edit and delete records using PHP and MySQL. I am using AJAX technology to add, edit and delete records with MySQL using Bootgrid.
Bootgrid is a powerful jQuery grid plugin that converts a simple HTML table into a grid with powerful features such as sorting, pagination, searching, add a record, edit a record, and delete the record functionality. Using PHP, MySQL, and ajax.
We will go over the features listed below. I did a lot of googling but couldn’t find any examples with the following characteristics.
- Bootgrid listing Using Ajax
- Bootgrid listing with search server-side using Ajax
- Enable ajax pagination
- Enable Sorting
- Enable Command button with for-matter function
- Enable server side dynamic pagination
- Add records using bootstrap ModalBox and ajax
- Edit records using bootstrap ModalBox and ajax
- Delete records using bootstrap ModalBox and ajax
In bootgrid, you can bind data in two ways: server-side (via a REST service) for querying a dynamic data source such as a database, or client-side (via simple in-memory data).
jQuery and Bootstrap are Bootgrid’s dependent libraries. We will learn how to use PHP, MySQL, and ajax to add, edit, and delete records in bootgrid.
Add, Edit and Delete records using Bootgrid, PHP and MySQL
I am using the following files and folder:
- dist folder: This folder will contain all css and js libs of jquery, bootstrap and bootgrid.
- font folder: This folder will contain all fonts related files.
- index.php: This file will use to create an HTML layout and handle ajax response.
- connection.php: This file will use to create a database connection.
- response.php: This file will use to handle all server side functionality. I will create add, edit, delete action methods and return back json response to ajax method.
Also Checkout other tutorials of grid,
- Simple Example Bootgrid (Server Side) with PHP, MySQL and Ajax
- How to Add, Edit and Delete a row in jQuery Flexigrid Using PHP and MySQL
- Datatable Pagination, Sorting and Search – Server Side (PHP/MySQl) Using Ajax
How to Add Listing in Bootgrid
Step 1: Created a connection file to handle the database connection and return the database connection object.
<?php Class dbObj{ /* Database connection start */ var $servername = "localhost"; var $username = "root"; var $password = ""; var $dbname = "test"; var $conn; function getConnstring() { $con = mysqli_connect($this----->servername, $this->username, $this->password, $this->dbname) or die("Connection failed: " . mysqli_connect_error()); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } else { $this->conn = $con; } return $this->conn; } } ?>
Where is:
- $servername: This variable contains your MySQL db hostname
- $username: This is the MySQL Database username.
- $password: This is the MySQL Database password.
- $dbname: This is the MySQL Database name.
Step 2: Included all js
and css
files into header of the index.php
file.
<script src="dist/jquery-1.11.1.min.js"></script> <script src="dist/bootstrap.min.js"></script> <script src="dist/jquery.bootgrid.min.js"></script>
Step 3: Created an HTML table to display listing data into the index.php
file.
<div class="col-sm-8"> <div class="well clearfix"> <div class="pull-right"><button id="command-add" class="btn btn-xs btn-primary" type="button" data-row-id="0"> Record</button></div> </div> <table id="employee_grid" class="table table-condensed table-hover table-striped" width="60%" cellspacing="0" data-toggle="bootgrid"> <thead> <tr> <th data-column-id="id" data-type="numeric" data-identifier="true">Empid</th> <th data-column-id="employee_name">Name</th> <th data-column-id="employee_salary">Salary</th> <th data-column-id="employee_age">Age</th> <th data-column-id="commands" data-formatter="commands" data-sortable="false">Commands</th> </tr> </thead> </table> </div>
Here, we’ve added a 'Add record'
button that will be used to create a new record and a table for listing records.
Step 4: Applied Bootgrid constructor method on HTML table.The Bootgrid method transforms an HTML table into a beautiful grid listing.
var grid = $("#employee_grid").bootgrid({ ajax: true, rowSelect: true, post: function () { /* To accumulate custom parameter with the request object */ return { id: "b0df282a-0d67-40e5-8558-c9e93b7befed" }; }, url: "response.php", formatters: { "commands": function(column, row) { return "<button id="" class="\"btn" type="\"button\"" data-row-id="\"""></button> " + "<button id="" class="\"btn" type="\"button\"" data-row-id="\"""></button>"; } } })
I added the above jquery code to the footer of the index.php
file.
Step 5: Let’s add action handler method into the response.php
file.
include("connection.php"); $db = new dbObj(); $connString = $db->getConnstring(); $params = $_REQUEST; $action = isset($params['action']) != '' ? $params['action'] : ''; $empCls = new Employee($connString); switch($action) { default: $empCls->getEmployees($params); return; } class Employee { protected $conn; protected $data = array(); function __construct($connString) { $this->conn = $connString; } public function getEmployees($params) { $this->data = $this->getRecords($params); echo json_encode($this->data); } function getRecords($params) { $rp = isset($params['rowCount']) ? $params['rowCount'] : 10; if (isset($params['current'])) { $page = $params['current']; } else { $page=1; }; $start_from = ($page-1) * $rp; $sql = $sqlRec = $sqlTot = $where = ''; if( !empty($params['searchPhrase']) ) { $where .=" WHERE "; $where .=" ( employee_name LIKE '".$params['searchPhrase']."%' "; $where .=" OR employee_salary LIKE '".$params['searchPhrase']."%' "; $where .=" OR employee_age LIKE '".$params['searchPhrase']."%' )"; } // getting total number records without any search $sql = "SELECT * FROM `employee` "; $sqlTot .= $sql; $sqlRec .= $sql; //concatenate search sql if value exist if(isset($where) && $where != '') { $sqlTot .= $where; $sqlRec .= $where; } if ($rp!=-1) $sqlRec .= " LIMIT ". $start_from .",".$rp; $qtot = mysqli_query($this->conn, $sqlTot) or die("error to fetch tot employees data"); $queryRecords = mysqli_query($this->conn, $sqlRec) or die("error to fetch employees data"); while( $row = mysqli_fetch_assoc($queryRecords) ) { $data[] = $row; } $json_data = array( "current" => intval($params['current']), "rowCount" => 10, "total" => intval($qtot->num_rows), "rows" => $data // total data array ); return $json_data; }
How to add insert record in Bootgrid
Step 1: In the index.php
file, I added a Bootstrap add modal box to add a record.
<div id="add_model" class="modal fade"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"><button class="close" type="button" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title">Add Employee</h4> </div> <div class="modal-body"><form id="frm_add" method="post"><input id="action" name="action" type="hidden" value="add" /> <div class="form-group"><label class="control-label" for="name">Name:</label> <input id="name" class="form-control" name="name" type="text" /></div> <div class="form-group"><label class="control-label" for="salary">Salary:</label> <input id="salary" class="form-control" name="salary" type="text" /></div> <div class="form-group"><label class="control-label" for="salary">Age:</label> <input id="age" class="form-control" name="age" type="text" /></div> </form></div> <div class="modal-footer"><button class="btn btn-default" type="button" data-dismiss="modal">Close</button> <button id="btn_add" class="btn btn-primary" type="button">Save</button></div> </div> </div> </div>
Step 2: To open the add modal box, I added a callback method to the 'add record'
button.
$( "#command-add" ).click(function() { $('#add_model').modal('show'); });
Step 3: Added a submit button event to add modal input values.
$( "#btn_add" ).click(function() { ajaxAction('add'); });
Step 4: Added the ajaxAction()
method, which will send an ajax request to the server. Using ajax technology, we will send json data to the server.
function ajaxAction(action) { data = $("#frm_"+action).serializeArray(); $.ajax({ type: "POST", url: "response.php", data: data, dataType: "json", success: function(response) { $('#'+action+'_model').modal('hide'); $("#employee_grid").bootgrid('reload'); } }); }
Step 5: Added a switch option in response.php
file.
case 'add': $empCls->insertEmployee($params); break;
Step 6: In the response.php
file, an add action method has been added that will insert a record into the MySQL database and send the status.
function insertEmployee($params) { $data = array();; $sql = "INSERT INTO `employee` (employee_name, employee_salary, employee_age) VALUES('" . $params["name"] . "', '" . $params["salary"] . "','" . $params["age"] . "'); "; echo $result = mysqli_query($this->conn, $sql) or die("error to insert employee data"); }
How to add Edit record in Bootgrid
Step 1: Added a Bootstrap edit modal box to the index.php
file to update the record.
<div id="edit_model" class="modal fade"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"><button class="close" type="button" data-dismiss="modal" aria-hidden="true">×</button> <p> </p> <h4 class="modal-title">Edit Employee</h4> </div> <div class="modal-body"><form id="frm_edit" method="post"><input id="action" name="action" type="hidden" value="edit"> <input id="edit_id" name="edit_id" type="hidden" value="0"> <p> </p> <div class="form-group"><label class="control-label" for="name">Name:</label> <input id="edit_name" class="form-control" name="edit_name" type="text"></div> <div class="form-group"><label class="control-label" for="salary">Salary:</label> <input id="edit_salary" class="form-control" name="edit_salary" type="text"></div> <div class="form-group"><label class="control-label" for="salary">Age:</label> <input id="edit_age" class="form-control" name="edit_age" type="text"></div> </form></div> <div class="modal-footer"><button class="btn btn-default" type="button" data-dismiss="modal">Close</button> <button id="btn_edit" class="btn btn-primary" type="button">Save</button></div> </div> </div> </div>
Step 2: Added callback method on event of Bootgrid contsructor,
.on("loaded.rs.jquery.bootgrid", function() { /* Executes after data is loaded and rendered */ grid.find(".command-edit").on("click", function(e) { //alert("You pressed edit on row: " + $(this).data("row-id")); var ele =$(this).parent(); var g_id = $(this).parent().siblings(':first').html(); var g_name = $(this).parent().siblings(':nth-of-type(2)').html(); $('#edit_model').modal('show'); if($(this).data("row-id") >0) { // collect the data $('#edit_id').val(ele.siblings(':first').html()); // in case we're changing the key $('#edit_name').val(ele.siblings(':nth-of-type(2)').html()); $('#edit_salary').val(ele.siblings(':nth-of-type(3)').html()); $('#edit_age').val(ele.siblings(':nth-of-type(4)').html()); } else { alert('Now row selected! First select row, then click edit button'); } }) })
We are collecting all data from the clicked row that you want to edit and display in the modal box.
Step 3: To edit the modal input values, a click event on the submit button has been added.
$( "#btn_edit" ).click(function() { ajaxAction('edit'); });
Step 4: Added a switch option in response.php
file.
case 'edit': $empCls->updateEmployee($params); break;
Step 5: In the response.php
file, an add action method has been added that will update the record in the MySQL database and send the status.
function updateEmployee($params) { $data = array(); //print_R($_POST);die; $sql = "Update `employee` set employee_name = '" . $params["edit_name"] . "', employee_salary='" . $params["edit_salary"]."', employee_age='" . $params["edit_age"] . "' WHERE id='".$_POST["edit_id"]."'"; echo $result = mysqli_query($this->conn, $sql) or die("error to update employee data"); }
How to add Delete record in Bootgrid
You must first select a row in Bootgrid and then click the delete record button icon. Each row in Bootgrid has an edit and delete row icon as well as a bound action.
Step 1: Added delete callback method under bootgrid constructor,
.end().find(".command-delete").on("click", function(e) { var conf = confirm('Delete ' + $(this).data("row-id") + ' items?'); alert(conf); if(conf){ /*$.post('response.php', { id: $(this).data("row-id"), action:'delete'} , function(){ // when ajax returns (callback), $("#employee_grid").bootgrid('reload'); }); */ //$(this).parent('tr').remove(); //$("#employee_grid").bootgrid('remove', $(this).data("row-id")) } })
Step 2: Added a switch option in response.php
file.
case 'delete': $empCls->deleteEmployee($params); break;
Step 3: In the response.php
file, an add action method has been added that will delete a record from the MySQL database and send the status.
function deleteEmployee($params) { $data = array(); //print_R($_POST);die; $sql = "delete from `employee` WHERE id='".$params["id"]."'"; echo $result = mysqli_query($this->conn, $sql) or die("error to delete employee data"); }
You can download source code and Demo from below link.
How To Use Downloaded Source Code
Conclusion :
In previous tutorial, we have learn listing of bootgrid with PHP, MySQL and AJAX.This tutorials help to add crud functionality with bootgrid using ajax.I have demonstrate about how to add,edit and delete row using php,mysql and ajax.
Thanks to this. help’s a lot
i hvnt add ajax call on delete method due to remove rec from db.
Ok Thanks!
Have to try to figure out myself, how to do this.
Update: Got it. Works brilliant! Thanks!
what did you do can u help me
u need to send code into gmail id
Lawrence Revano – Sorry for not getting back to you. Haven’t seen your question until now. Do you still need the solution?
how to
add extra colomn and insert extra colom values
make sure extra col must be in your table, add one entry into table th.
i verified edit option in demo link,its working fine
hi sir, how to enable mobile responsive for this table?
by table-responsive class
whats error showing ?
Sample code download zip missing container.php and footer.php…
Contents of those files would be greatly appreciated!
U can remove container nd footer include php method,thats only template purpose
Hi,
I am using this currently and its working great. I would like to implement inline editing with this. Do you think its possible with jQuery bootgrid? If yes, a few suggestions would be really helpful!
Thanks so much!
I m not sure,you can use other jquery plugin as well like datatable providing inline editing.
Hi, newbie question. How can i link the database? I’m currently using xampp and still cant connect even thou i changed the database locations
Can u plz send the code in gmail id,i ll look into this
hi i have commented delete option, you uncomment del ajax like,
.end().find(“.command-delete”).on(“click”, function(e)
{
var conf = confirm(‘Delete ‘ + $(this).data(“row-id”) + ‘ items?’);
alert(conf);
if(conf){
/*$.post(‘response.php’, { id: $(this).data(“row-id”), action:’delete’}
, function(){
// when ajax returns (callback),
$(“#employee_grid”).bootgrid(‘reload’);
}); */
//$(this).parent(‘tr’).remove();
//$(“#employee_grid”).bootgrid(‘remove’, $(this).data(“row-id”))
}
});
response.php file,
case ‘delete’:
$empCls->deleteEmployee($params);
break;
function deleteEmployee($params) {
$data = array();
//print_R($_POST);die;
$sql = “delete from `employee` WHERE id='”.$params[“id”].”‘”;
echo $result = mysqli_query($this->conn, $sql) or die(“error to delete employee data”);
}
attached fresh source code,please make sure sql table col name must be same,if not please change code accordingly your col name.
Yup got it .. thank you for nice plugin .. 🙂
i have shared del code with any comment thread, please take reference from there.
Thank u so much sir 🙂
There id Problem when i m including your code in my other code which already have style.css .Bootstap style.css conflicts.is
there is any solution to handle it.
you can change id as per your need.
i have fixed that, now sorting and searching working perfectly
Thank you, can you tell us where did you fix the sorting issue? It was something on your code or a new version of the bootgrid library? Thank you
Something my code
hiding use to not display field in edit form, i verified and found saving working perfectly.
Hi,
Amazing Code¡¡¡
Is possible add other action methods that, for example, send mail to list address?
Thanks
Thanks, yes,its possible
tnx
Hi,
Do you have solution to add additional rowCount function:
QUOTE
rowCount An Array of Integer which will be shown in the dropdown box to choose the row count. Default value is [10, 25, 50, -1]. -1 means all. When passing an Integer value the dropdown box will disapear.
UNQUOTE
I want to add in 5 to display in the datatable. Changing the related .js script doesn’t work.
Also specifying column width is not working. How can it be like column widths be set to auto width instead (text-wrapped)
Thanks
Yes you can add and passed drodwon value with grid request to server for sql query limit
I don’t know how to do it., can you help show how?
Hello,
In window “Edit Employee”, why there fields are not placed in a correct position ?
I obtained this result when I hide “Empid” column.
As you can see in the screenshot, “Age” is placed in the “Salary” field, and “Salary” is placed in the “Name” field.
Thank you !
https://uploads.disquscdn.com/images/3bcf0c0ebdbaaa1b89cf7660a7ed28616743b5d6b38fff6e54ca9e80ac87d923.jpg
How can I specify column width of table? I try it but not working. I want to define individual column width for each column instead of auto width.
Hello,
What an excellent tutorial.. help me alot!
Anyway is there a way when click the save button (edit mode for example) the grid is load with the current page not refresh and back to the first page.
Then, for some reason my save button click didn’t close the pop up (hide the div) but the save function working with no problem.. is it possible because of my action after update the table.. the script will fire an email to the user ?.
Thank you!
need to add ajax methhod
need to debug code, i m not sure.You can use alternate way, like combine two column in tmp variable and then assign table json
where is the download link?
Add the bottom of tuts,to unlock link need to share tuts
U can also add inline css with in col, or in formatter callback method
You can add a mew row at the bottom table and aggregate tot using formatter
Without error msg and code, i cant help u.i just assume problem.You can send sql file with source code,i ll try my best to solve ur error,
Ok,for now I dint get any error.You code quit good,and you have explain the code clearly.
But can I ask one more question?
May I know how to select certain data to display?If normal php code,I can do it,but jquery I really no idea
exp:
sql=”SELECT * FROM `cusinfo` where id = ‘$ID’ “;
I dunno where to put this code,and what should replace with this code
You can never define sql query in jquery.you can create ajax and pass sql as a parameter
sorry about keep asking nonsense question.Can you give me an example of how to create ajax and pass it?Or can you give me a link to learn about it?Im really just new to ajax and jquery
sorry bro, right do not have script
I shared 2 tuts for boot grod ,yoi can refer first simple bootgrid listing
I have removed the commented out alert box. And I am getting “You have pressed row : undefined”
I have changed the code a little bit. What could e the possible reason?
Thanking you in advance.
may be cache issue,if removed right alert box then it would be not show msg.
Thx for this, super useful.
While I correctly set up the connection to the db, the initial form is stuck on “loading” and data is never displayed. (there are no error messages displayed)
What am i missing?
Whats error in console
Hi there and thanks for that script.
I got the same issue as SB.
I went in the firefox console to check the error and got : SyntaxError: JSON.parse: unexpected character at line 2 column 1 of the JSON data
It would be super nice if you could help as I cannot figure it out. thanks in advance
need to validate your sample json data, something wrong between them
where this file is stored?
which file?
Before edit or delete record, first we need to select row
there is alternate option, you can create input and add hide class on that.
Hi
This is great code and I am using it without any issue.
Just I have to include when Inserting Data to table, I need to run 3 different queries depending on conditions, I am just unable to get the result;
here is code
function insertFillEmpty($params) {
$data = array();
$catintid = “SELECT categoryinternalID FROM inhandemptystock”;
$results = mysqli_query($this->conn, $catintid);
$raw = mysql_fetch_array($results);
$idcat = $raw[“categoryinternalID”];
if ($idcat == “5”) {
$sqll = “INSERT INTO `testing` (goog) VALUES(‘” . $params[“enteredBy”] . “‘); “;
echo $result = mysqli_query($this->conn, $sqll) or die(“error to insert employee data”);
} else {
echo ”;
echo ‘alert(“Something is wrong”)’;
echo ”;
}
}
Can you please help me to sort out the issue?
I want to run different query as per ID received from table, Please help to resolve;
//include connection file
include_once(“connection.php”);
$db = new dbObj();
$connString = $db->getConnstring();
$params = $_REQUEST;
$action = isset($params[‘action’]) != ” ? $params[‘action’] : ”;
$empCls = new FillEmpty($connString);
switch($action) {
case ‘add’:
$empCls->insertFillEmpty($params);
break;
case ‘edit’:
$empCls->updateFillEmpty($params);
break;
case ‘delete’:
$empCls->deleteFillEmpty($params);
break;
default:
$empCls->getFillEmpty($params);
return;
}
class FillEmpty {
protected $conn;
protected $data = array();
function __construct($connString) {
$this->conn = $connString;
}
public function getFillEmpty($params) {
$this->data = $this->getRecords($params);
echo json_encode($this->data);
}
function insertFillEmpty($params) {
$data = array();
$catintid = “SELECT categoryinternalID FROM inhandemptystock”;
$results = mysqli_query($this->conn, $catintid);
$raw = mysql_fetch_array($results);
$idcat = $raw[“categoryinternalID”];
if ($idcat == “5”) {
$sqll = “INSERT INTO `testing` (goog) VALUES(‘” . $params[“enteredBy”] . “‘); “;
echo $result = mysqli_query($this->conn, $sqll) or die(“error to insert employee data”);
} else {
echo ”;
echo ‘alert(“Something is wrong”)’;
echo ”;
}
}
it shows connection failed i think syntax is wrong can u modify https://uploads.disquscdn.com/images/8c135f57213fb2419c45917754a69f5521466086627d167ef6145b26c3cbf41c.png
whats err msg//.
Of course the id field is necessary. Also, I have another important identifying field used to pull records only for the current user. I do not want either of these fields to show up on the table, but need to access both of them. I cannot figure out a way to hide them in the table without presenting other problems. Could you please tell me how you would do this?
Also, I tried setting column widths in the table using inline CSS. I believe you told another user this was possible, but, for some reason, it did not work for me.
Thanks very much for the code. You need a donation button.
In addition to the record id, I also pull another field that is crucial, as it belongs to the current user. I need to access both of these variables. My problem is that I do not want these two fields to display in the table, they are superfluous to the user. In the “Add” and “Edit” forms, I simply make this hidden inputs. Everything I have tried as far as hiding these fields from the table results in other problems. Is there a way I can do this without rewriting most of the code?
Additionally, I believe you told another person that one could use HTML or CSS width commands to control the column widths, but this has not worked for me using either.
The css file has .bootgrid-table {table-layout: fixed;} This will override column width settings. Commenting out solves that problem.
Still no idea how to hide columns without affecting add and edit form data.
hello guys,
i downloaded the source code and i have got a problem .However i can do all the actions of the table (insert ,delete ) ,i cannot get the values from my database .It only shows me the id.When i press the action to edit ,all fields have value.Can someone help me ?
you can print you sql query and run manually on query browser, may be some col name issue
thanx you! you help me to find the sulotion. I would like to ask you something more. I would like to add extra button in the command column. This button would keep employee id as apost. The button has href tag in another url how can i do this?
you need read bootgrid official docs for this,
Hello,
i would like to add a command button that it keeps the selected row id of the table id=”employee_grid” in a input value of the form .Then to open a modal with another table to keep the id in a 2nd input value type of the form.
when i do the action ,it will success only when i click the first elements of the table.
Could you give me any advice of this?
Thank you!
my script command button has this code:
.end().find(“.command-courses”).on(“click”, function(e)
{
document.getElementById(“id_form”).value = $(this).data(“row-id”);
$(‘#courses_to_show’).modal(‘show’);
});
});
Help please… 🙁
My database isn’t connecting 🙁
error msg pls?
How can I add employee picture on add employee form and send picture into database and folder by response.php file
same like salary column, we just need to create a clumn name is profile_image, store path into this col, and upload file into image folder.
sul be work nth-of-type() method
Hey when i am trying this code, data is not getting loaded into datatable, what will be the reason for that, what i am missing, can u guide me in this
may be data is not formatted as col name in bootgrid, hv u checked data in network tab.
Awesome! Thanks you very much again! problem solved!
may be not bind with class name
Hello,
thank you very much for this awesome tutorial!!!
i want to add a new button near “Record” on the top named “Show open Records”.
I have in my Database a column called “status” with possible values “open” and “closed”.
What is the best to show all open Records via Button.
In my getRecords function i have
SELECT * FROM employee
But if I press the Button “Show open Records” i want to execute:
SELECT * FROM employee WHERE status = ‘open’
Hello,
Thank you very much for this tutorial. I want to ask how to validate to make sure it will not save empty form. I try to use “required” at the input part, but it seems it didn’t work. Could you help me?
https://uploads.disquscdn.com/images/505882ed75a241989e9af2bae1cadb83e326822f903dc0aab6c2361a3d4c6499.jpg
you can use core javascript or jquery to validate form.
Dear phpflow!
How i can i add more colums to the table and is there any solution to multipy 2 colums?
I havnt tried, get more info official docs of bootgrid
Same as Akos, i need to add more columns, i see the Bootgrid docs but there is no info about that.
as fast as i change the names of ID’s in html labels everythigs scrup up.
ok, can u plz send table structure to add more col in bootgrid.
Hello good evening, can you help me to show the no result if you search that didn’t exist in the table.
thanks.
you can send string msg from php side
It’s possible to search, and put all the tables from database, into a , then config a button to display the results from the selected table?
yes
Can you help how to do that becouse i try but i stuck in that part…
” .$lala. “”;
}
$selectOption = $_POST[‘taskOption’];
mysql_free_result($result);
?>
Tabela – “,”$selectOption”,””; ?>
Procurar
yes, using$server[post] option
Hi mate your code is awesome, just one thing if u hide the colum when
you will go to edit, you cant get the old value, any tips for the fix?
you can get using jquery
hi,i just hidden the column with css and solved my problem, if anyone need this simple solution I can post the code.
Hi Francesco, i need your solution please. Can you post-it ? Thanks
“Now row selected! First select row, then click edit button”.can not update data.pls help me.thanks
Whats error getting in console.
sir,data edit model pop up box work properly but after update my database the model not close automaticaly.i close manualy.
you can close model by .close() method
i sent mail with downld link on your email.
i hv sent
Hi! Thank you for code.
How can i translate or remove message “true” after deletting employee?
search in files and replace.
bro i am using image in database so could you please tell me how to fetch image from database using these code..image should be show instead of showing its name…please help it’s urgent
you need to bind img html tag and add image path with src attribute
i need time to write code,i ll post soon
no, I just sent u mail with source code link.
You can set editable property of that column
thanks for your respnonse Parvez. Can u elaborate a bit please. How do we set the editable property?
you can also remove modal input from edit model html code and unset value using grid.find(“.command-edit”) function
Hi Parvez, I think you misunderstood my question. I do not want to remove the column. I want to remove the “& nbsp” that shows up in the edit modal for columns with no values.
You can set empty value using .val() method
Iam applying an sql filter in getUpdate function in response.php and
getting a specific records of customers listed in table. But when I
search for a record in search bar it doesnt display anything. Kindly
help me out, I tried a lot with mysql query but could not achieve the
result.
function getRecords($params) {
$sql = “SELECT * FROM customer WHERE agent_name =’HARRY'”;
$sqlTot .= $sql;
$sqlRec .= $sql;
just below added condition to return empty when $where is null
from where i can get download link
i sent link into email id
Hi,
I had the same problem. To solve it, I did this:
$(‘#edit_name’).val(ele.siblings(‘:nth-of-type(2)’).html().replace(/ /g, ”));
how to print all datagrid data?
can u provide a tutorial??
thx a lot
you can use any print plugin or get reference from https://phpflow.com/php/export-html-table-data-to-excel-csv-png-and-pdf-using-jquery-plugin/
Thanks…It Works….!!!
need to read docs, i am not sure
What do I do wrong?
The row.id will be blank.
need one primary col to identify row, how to delete row without primary key?
Thank you very much for this tutorial. I want to ask how to select one row and I would like to display this row on other page?
you can add view button against on each row
Hello. Excellent article and example.
How can I use this construct when adding/editing a row:
One
Two
?
Many thanks for the help.
Hi,
You need to see bootgrid docs,
means , your id is not configured with row id.
yes you can use but with wordwrap.
Hello
can be done to get the results above?
reverse numbering
…
7
6
5
4
3
2
1
yes, using id in desc manner using sql query
I want to use this for my assignment in which i have a table of 22 columns and around 20k enteries …… please assist
for this you need to add server side pagination otherwise it will take more time to load all records, you can manage col using col filter option.
uploading a file, you can create separate feature to show modal box that have upload file modal box.
Great tutorial i wish to hide the primary key column from showing
you can remove Empid or add hide css class
How can I change the datatypes of the rows? I want to use my own employee table but there are different datatypes to your table. Where can I change this?
you need to change response.php and js code.
create dynamic table column based on query and passed to response.php file
Thank you for tutorial
Hi. Your work is amazing. I tried with above code but its not working for me. Can you sent me the source code so i could use it in my project. Thank you
ping me email id on [email protected]
Hello, thanks for the code. Am getting the following error on my cpanel:
“PHP Warning: PHP Startup: Unable to load dynamic library ‘/opt/alt/php56/usr/lib64/php/modules/intl.so’ – libicui18n.so.57: cannot open shared object file: No such file or directory in Unknown on line 0”
what could be the cause?
this is your PHP installation issue, I believe its not related to this tutorial.
How do new posts appear first?
sort record by posted time