Skip to content

Commit 97bbe8d

Browse files
author
Dipu Raj
committed
Beta updates
1 parent 52ab0af commit 97bbe8d

File tree

7 files changed

+341
-147
lines changed

7 files changed

+341
-147
lines changed

.gitignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,49 @@
44
*/cache/*
55
!*/cache/index.html
66
!*/cache/.htaccess
7+
/nbproject/private/
8+
.DS_Store
9+
10+
application/cache/*
11+
application/logs/*
12+
/vendor/
13+
14+
# IDE Files
15+
#-------------------------
16+
/nbproject/
17+
.idea/*
18+
19+
## Sublime Text cache files
20+
*.tmlanguage.cache
21+
*.tmPreferences.cache
22+
*.stTheme.cache
23+
*.sublime-workspace
24+
*.sublime-project
25+
26+
# CI Project
27+
#-------------------------
28+
.gitignore
29+
contributing.md
30+
index.php
31+
/system/*
32+
application/config/*
33+
application/core/*
34+
application/helpers/*
35+
application/hooks/*
36+
application/language/*
37+
application/models/*
38+
application/third_party/*
39+
application/views/*
40+
!application/libraries/SmartGrid/*
41+
/license.txt
42+
/readme.rst
43+
/application/.htaccess
44+
/application/index.html
45+
/application/controllers/Welcome.php
46+
/application/controllers/index.html
47+
/application/libraries/index.html
48+
!/application/views/example_smartgrid.php
49+
/mpp.txt
50+
!/application/views/smartgrid_and_datatables.php
51+
!/application/views/example_smartgrid_arraygrid.php
52+
!/application/config/smartgrid.php

.travis.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
# SmartGrid for CodeIgniter with Bootstrap
2-
A simple PHP datagrid control for CodeIgniter framework with Bootstrap.
1+
# CodeIgniter SmartGrid
2+
### A simple PHP datagrid control for CodeIgniter with Bootstrap support
3+
4+
35
SmartGrid focus on data display than data manipulation.
46
We are starting with limited features to make the code very simple and robust,
57
yet we will be adding more feature on the go. The code is very simple and well documented, which make it easy for customization.
@@ -79,7 +81,7 @@ Limitations
7981

8082
Version
8183
-----
82-
**SmartGrid v0.6.1-beta**
84+
**SmartGrid v0.6.5-beta**
8385
> Notice:- SmartGrid is on beta version, usage on production environment is not recommended unless tested well.
8486
> Please report issue at [github issues](https://github.com/techlab/codeigniter-smartgrid/issues/)
8587

application/config/smartgrid.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
/**
3+
* SmartGrid for CodeIgniter with Bootstrap
4+
* -----------------------------------------
5+
* SmartGrid configuration settings
6+
* -----------------------------------------
7+
*
8+
* @package SmartGrid
9+
* @version v0.6.1-beta
10+
* @license MIT License
11+
* @copyright Copyright (c) Dipu Raj and TechLaboratory.net
12+
* @author Dipu Raj
13+
* @author-website http://dipuraj.me
14+
* @project-website http://www.techlaboratory.net/smartgrid
15+
* @github https://github.com/techlab/codeigniter-smartgrid
16+
*/
17+
defined('BASEPATH') OR exit('No direct script access allowed');
18+
19+
$config['auto_generate_columns'] = false;
20+
$config['paging_enabled'] = true;
21+
$config['page_size'] = 10;
22+
$config['toolbar_position'] = 'both';
23+
$config['grid_form_method'] = 'GET';
24+
$config['grid_name'] = '';
25+
$config['debug_mode'] = false;

application/controllers/Example_smartgrid.php

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@ class Example_smartgrid extends CI_Controller {
55

66
public function index()
77
{
8-
$employee_name = trim($this->input->get_post('employee_name', TRUE));
9-
10-
// Load the SmartGrid Library
11-
$this->load->library('SmartGrid/Smartgrid');
12-
8+
$employee_name = $this->input->post_get('employee_name', TRUE);
9+
$data['employee_name'] = $employee_name;
1310
// SQl for grid
1411
$where = '';
1512
$where .= !empty($employee_name) ? " AND employee_name LIKE '%$employee_name%' " : "";
@@ -24,26 +21,28 @@ public function index()
2421
"2"=>"Female"
2522
);
2623

24+
$buttons_html = '<div class="btn-group" role="group" aria-label=""><button type="button" class="btn btn-default btn-xs" value="{field_name}">View</button><button type="button" class="btn btn-success btn-xs" value="{field_name}">Edit</button> <button type="button" class="btn btn-danger btn-xs" value="{field_name}">Delete</button></div>';
25+
2726
// Column settings
2827
$columns = array(
29-
"employee_id"=>array("header"=>"Employee ID", "type"=>"label", "align"=>"left", "width"=>"100px"),
30-
"employee_name"=>array("header"=>"Employee Name", "type"=>"label", "align"=>"left", "width"=>"150px"),
31-
"employee_dob"=>array("header"=>"Date of Birth", "type"=>"date", "align"=>"center", "width"=>"150px", "date_format"=>"Y-m-d", "date_format_from"=>"Y-m-d H:i:s"),
32-
"employee_join_date"=>array("header"=>"Join Date", "type"=>"relativedate", "align"=>"left", "width"=>"150px"),
33-
"employee_gender"=>array("header"=>"Gender", "type"=>"enum", "source"=>$gender_list, "align"=>"center", "width"=>"100px"),
34-
"employee_salary"=>array("header"=>"Salary", "type"=>"money", "sign"=>"$", "align"=>"right", "width"=>"100px"),
35-
"performance_index"=>array("header"=>"Performance", "type"=>"progressbar", "align"=>"center", "width"=>"100px"),
36-
// "employee_img_url"=>array("header"=>"Image", "type"=>"image", "align"=>"center", "width"=>"50px", "image_width"=>"50px"),
28+
"employee_id"=>array("type"=>"label", "header"=>"Employee ID", "align"=>"left", "width"=>"100px"),
29+
"employee_name"=>array("type"=>"label", "header"=>"Employee Name", "align"=>"left", "width"=>""),
30+
"employee_dob"=>array("type"=>"date", "header"=>"Date of Birth", "align"=>"center", "header_align"=>"center", "width"=>"150px", "date_format"=>"Y-m-d", "date_format_from"=>"Y-m-d H:i:s"),
31+
"employee_join_date"=>array("type"=>"relativedate", "header"=>"Join Date", "align"=>"left", "width"=>"100px"),
32+
"employee_gender"=>array("type"=>"enum", "header"=>"Gender", "source"=>$gender_list, "align"=>"center", "width"=>"80px"),
33+
"employee_salary"=>array("type"=>"money", "header"=>"Salary", "sign"=>"$", "align"=>"right", "width"=>"100px"),
34+
"performance_index"=>array("type"=>"progressbar", "header"=>"Performance", "align"=>"center", "width"=>"150px", "style" => "progress-bar-info"),
35+
"employee_img_url"=>array("type"=>"custom", "header"=>"Buttons", "field_data"=>$buttons_html, "align"=>"center", "width"=>"130px"),
3736
);
3837

3938
// Config settings, optional
4039
$config = array("page_size"=> 5,
41-
"grid_name"=> "sg_1",
4240
"toolbar_position"=> 'both');
4341

42+
// Load the SmartGrid Library
43+
$this->load->library('SmartGrid/Smartgrid');
4444
// Set the grid
4545
$this->smartgrid->set_grid($sql, $columns, $config);
46-
4746
// Render the grid and assign to data array, so it can be print to on the view
4847
$data['grid_html'] = $this->smartgrid->render_grid();
4948

0 commit comments

Comments
 (0)