GithubHelp home page GithubHelp logo

harish-tipstat / datatable_server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shabeer-ali-m/datatable_server

0.0 2.0 0.0 140 KB

Datatable server is php code that you can create json easily for ajax datatable.

License: MIT License

PHP 100.00%

datatable_server's Introduction

Datatable Server

======================

Datatable server .

  • Easy to use
  • Codeignator plug-in available.

Datatable server is php code that you can create json easily for [ajax datatable].

The overriding design goal for Datatable Server PHP function is to create json easily with less configuration for datatable.

Version

1.0.1

Codeigniter Usage

Installation

You need to add [codeigniter/datatable_server_helper.php] in Codeigniter helpers folder: (yourproject/application/helpers/)

Usage

Call the function in your controller

//your custom function to call inside json render
function your_function($mobile){
    return $mobile;
}

$this->load->helper('datatable_server');
$config=array(
    // Coloums you need to select form database. [Array()]
    'aColumns' => array( 'id','name','email','mobile'),
	 
    //Index coloum of the table.	[String]
    'sIndexColumn' => 'id', 
	 
    // Table name 	[String]
 	// You can also gave join statement
 	// ex : 'sTable' =>"order left join invoice on invoiceid=orderid" ,
    'sTable' =>"address-book" , 	
	
    //If you have any conditional statement you can add like this. [String][optional]
    //'sCondition'=>'name like "%a"',	
		
	//Output needed in each coloum. [Array(Array('type'=>value))]
	// Usage
	// text	=>	Normal Text values
	// var =>  Variable Name.The variable name will replaced with the variable value.
	// The variable that you are selecting should be added in aColoums.
	// html =>  You can directly gave html. If you want to use variable in between you can use {{variable name}}.
	 // eval =>  You can call a function that you have written.You can use the arguments as your variable that you selected in aColoums.
     'aColumns_out' => array( 
         array('var'=>'id'),
         array('var'=>'name',
         array('html'=>'<a href="mailto:{{email}}">{{email}}</a>'),
         array('eval'=>'your_function($mobile)'),
        ),
     );	
echo dt_get_json($config);

License

MIT [codeigniter/datatable_server_helper.php]:https://github.com/shabeer-ali-m/datatable_server/blob/master/codeigniter/datatable_server_helper.php [ajax datatable]:http://www.datatables.net/examples/data_sources/server_side.html

datatable_server's People

Contributors

shabeer-ali-m avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.