HOW 2 CREATE NUMBER IN COLOUM DATA IN GRUCERY CRUUD LIKE THIS
CHECK THE PICTURE
CREATE A NUMBER OF COLOM
- Single Page
Posted 02 July 2013 - 14:26 PM
Posted 02 July 2013 - 16:35 PM
Well you can create a column callback to the column.
There.. initialize the value that needs to be populated. Usually will be initialized based on the page number * rows to display...
and store the number in session. Every call increment it and store it back in session for next call ..
this way you should achieve it with ease.
Posted 03 July 2013 - 01:43 AM
can u give me the example ? . . . . i dont understand function callback to the coloum . . . less a simple of the code in grucerycrud.com
Posted 03 July 2013 - 08:22 AM
Which theme do you use?
Posted 03 July 2013 - 08:33 AM
// in your controller ... $crud->columns('number','field1',...,'fieldx'); $crud->callback_column('number',array($this,'_callback_number'); ... // callback function public function _callback_number($value, $row) { // calculate the number that needs to be displayed // you should come up with some kind of algorithm for this // let's say this algorithm stores the number in variable $number return '<div class="text-left">' . $number . '</div>'; }
Posted 03 July 2013 - 08:37 AM
Which theme do you use?
Good point Victor!!! ;)
Clever thinking!!!
Posted 03 July 2013 - 12:10 PM
flexi grid sir victor . . . .can u give me exxample . . . i try that code now thx all dude
Posted 03 July 2013 - 12:25 PM
ur code has eror sir . . . . can u give another ?
Posted 03 July 2013 - 12:31 PM
ur code has eror sir . . . . can u give another ?
Posted 03 July 2013 - 12:51 PM
Posted 03 July 2013 - 12:55 PM
but you can make it using callback column
Posted 03 July 2013 - 22:36 PM
can u give example for callback column ? . . . more easy if i use them . . . :)
Posted 03 July 2013 - 22:43 PM
learn the documentation.
you can use callback function for the "id" field.
and look at my example from that page.
I have no time to make it for you because I have a lot of work
Posted 04 July 2013 - 08:35 AM
ur code has eror sir . . . . can u give another ?
My code isn't a real code! It is an example! You need to learn how to code first!
Take some programming lessons!
Posted 04 July 2013 - 12:15 PM
ha ha ha ha i beginer programer sir :) . . . . i will try . . . but can u share the code ? :D
Posted 05 July 2013 - 09:40 AM