Events in the fields.
- Single Page
Posted 25 March 2012 - 03:08 AM
I've just started using this library, tryed to use the datatables sometime ago, found the design awesome. This mix is really very very good. Congratulations.
My question is: I want to use some .js events in the fields, Form Masks to be more exactly. In my previous crud i was doing this:
<?php $data_nasc1 = array(
'name' => 'data_nasc',
'id' => 'data_nasc',
'onKeyPress' => 'Data(event, this)',
'value' => set_value('data_nasc'),
'maxlength' => '8',
'class' => 'data',); echo form_input($data_nasc1);?>
How can i do this whit grocerycrud? >>> 'onKeyPress' => 'Data(event, this)' .
Its some variable using change_field_type?
Posted 25 March 2012 - 17:11 PM
$(document).ready(function() {
$("#target").keypress(function() {
alert("Handler for .keypress() called.");
});
});
Posted 25 March 2012 - 23:05 PM
Think you'll have to use some jQuery in the view...basic onkeypress example:
[/quote]
Just got home and saw this. Sometimes the aswer is in the first page. I was digging too much haha.
Callbacks are almost everywhere
Everything is automated but you are free to change almost everything. You can customize columns, fields and all the operations with a quick callback. There are examples to understand how callbacks work
[color=#b1b100]return[/color] [color=#ff0000]'+30 <input type="text" maxlength="50" value="'[/color].[color=#0000ff]$value[/color].[color=#ff0000]'" name="phone" style="width:462px">'[/color];
The solution was a simple Callback. Guess im just new to the thing hehe. Thanks anyway.
Posted 26 March 2012 - 05:56 AM