search table list with js

from : http://stackoverflow.com/questions/14713622/twitter-bootstrap-row-filter-search-box
Thanks Filipp Lepalaan

//filtering table within result
 $('input.filter').bind('keyup', function() {
 var rex = new RegExp($(this).val(), 'i');
 $('.searchable tr').hide();
 $('.searchable tr').filter(function() {
 return rex.test($(this).text());
 }).show();
 });

To use it, you just create a table, with a tbody with the class "searchable" and then an input with class "filter" somewhere on your page (I prefer to put them in a Bootstrap Popup behind a search icon).

Advertisements

Reverse engineering development with Symfony2

$ php app/console doctrine:mapping:convert xml ./src/Acme/DemoBundle/Resources/config/doctrine/metadata/orm --from-database --force

## add mapping unknown types
doctrine:
dbal:
connections:
default:
// Other connections parameters
mapping_types:
oid: string

 

## generate Entities from DB
$ php app/console doctrine:mapping:import --em=foo AcmeDemoBundle annotation
## generate get//set method in Entity File
$ php app/console doctrine:generate:entities AcmeDemoBundle