⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Grocer CRUD CSS



pkiyingi
  • profile picture
  • Member

Posted 23 November 2013 - 13:53 PM

Thanks guys this is a good CRUD really but have few challenges.

1. I am using bootstrap as my theme now i need to color my colomns backgrounds  diferently but it seems this library can only support text coloring.

Does any one know the solution to this..

 

 

      
    function color($value, $row)
{
return '<span style="background-color:red">'.$value.'<span>';
}
 

this only creates a bgcolor on the text...

 

 

 

2. I need to merge common cells into one cell many rows into

 

MONDAY

TEST DATA

 

 

 

 

 

TEST DATA2

 

 

TUESDAY

TEST DATA3

 

 

 

 

 

ANY BODY PLEASE HELP ME THANKS....

 


Amit Shah
  • profile picture
  • Member

Posted 24 November 2013 - 05:34 AM

Hi there...

 

As for a solution to one of your requirement - applying color to column background, below is a sample script you can add up using $crud->set_js

//Below code will change the background of the 3d column to red. 
window.onload() {
    $('table th:nth-child(3), table td:nth-child(3)').addClass('red');
}

//If you wish to fill color for the column dynamically .. then there is another way out with javascript.

var txt = 'Header 2';
var column = $('table tr th').filter(function() {
    return $(this).text() === txt;
}).index();

if(column > -1) {
    $('table tr').each(function() {
        $(this).find('td').eq(column).css('background-color', '#eee');
    });
}

Similarly you can control to change the color of background of any column you wish to.

 

As for having multiple columns into one column -

you can have a column defined in $crud->column (which may / may not exist in the table) - use column callback and add up as many columns as you want.. the way you plan to format and return it for display.

 

 

Happy GCing :)