[web2py] Re: Smarttable & SQLFORM.grid

2012-03-30 Thread greenpoise
Yours is more elaborate!  I am doing a hybrid on the smarttable one 
(www.datatables.net). Nothing fancy, just adding an additional button for 
the actions rather than links. This way I get the live-search plus the add 
button I want.


Thanks



d



On Thursday, 29 March 2012 15:18:07 UTC-7, Derek wrote:
>
> I get what you are saying. I wrote a function (not on web2py, but it's 
> javascript...) 
>
>
> // this will capture the 'enter' key when pressed inside the text box, so 
> searching works better.
> function IEKeyCap(e)
> {
>
> if (e.keyCode == 13) {dsCustomers.filter(myFilterFunc)};
>
> }
>
> function FilterData()
> {
> dsCustomers.filter(myFilterFunc);
> }
>
> function StartFilterTimer()
> {
> if (StartFilterTimer.timerID)
> clearTimeout(StartFilterTimer.timerID);
> StartFilterTimer.timerID = setTimeout(function() { 
> StartFilterTimer.timerID = null; FilterData(); }, 100);
> }
>
> and here was my html that fired it...
>  name="srch" id="srch">
>
> This was using the Adobe Spry framework, but it's essentially the same.
> When you press a key, it starts the timer (for 100ms). If the timer was 
> already going and you press another key, it restarts the timer.
> After 100ms, it then calls the filter function. If they press enter 
> (keycode 13) it will also call the filter function.
>
> I think the problem here is that the SQLFORM.smartgrid isn't AJAX, in that 
> when you click 'search' instead of just reloading the grid with the 
> filtered data, it just redirects you (to the exact same page you're on) and 
> shows you the filtered data. 
>
> The only way I know to do it with AJAX is to write my own smartgrid, or 
> use Adobe Spry Framework because it's awesome - and you can just tell 
> web2py that you want that dict as a json.
>
> On Monday, March 26, 2012 1:24:42 PM UTC-7, greenpoise wrote:
>>
>> What I was looking for was a type-ahead function using SQLFORM.smartgrid 
>> instead of typing a word and pressing search.
>>
>>
>>
>>
>>
>>
>>
>>
>> On Thursday, 22 March 2012 16:15:23 UTC-7, Alan Etkin wrote:
>>>
>>> I think you mean SQLFORM.smartgrid. 
>>>
>>> Book's 7.8 section (the features are explained there): 
>>>
>>> "... 
>>> A SQLFORM.smartgrid looks a lot like a grid, in fact it contains a 
>>> grid but it is 
>>> designed to take as input not a query but only one table and to browse 
>>> said 
>>> table and selected referencing tables. 
>>> ..." 
>>>
>>> On Mar 22, 7:16 pm, greenpoise  wrote: 
>>> > Are these two equivalents?? I remember using smartables at some point. 
>>> What 
>>> > I liked about it was the search feature without having to press any 
>>> button 
>>> > to search for my text within a table. Does SQLFORM.grid provides 
>>> something 
>>> > similar?? 
>>> > 
>>> > Thanks 
>>> > 
>>> > d
>>
>>

[web2py] Re: Smarttable & SQLFORM.grid

2012-03-29 Thread Derek
I get what you are saying. I wrote a function (not on web2py, but it's 
javascript...) 


// this will capture the 'enter' key when pressed inside the text box, so 
searching works better.
function IEKeyCap(e)
{

if (e.keyCode == 13) {dsCustomers.filter(myFilterFunc)};

}

function FilterData()
{
dsCustomers.filter(myFilterFunc);
}

function StartFilterTimer()
{
if (StartFilterTimer.timerID)
clearTimeout(StartFilterTimer.timerID);
StartFilterTimer.timerID = setTimeout(function() { StartFilterTimer.timerID 
= null; FilterData(); }, 100);
}

and here was my html that fired it...


This was using the Adobe Spry framework, but it's essentially the same.
When you press a key, it starts the timer (for 100ms). If the timer was 
already going and you press another key, it restarts the timer.
After 100ms, it then calls the filter function. If they press enter 
(keycode 13) it will also call the filter function.

I think the problem here is that the SQLFORM.smartgrid isn't AJAX, in that 
when you click 'search' instead of just reloading the grid with the 
filtered data, it just redirects you (to the exact same page you're on) and 
shows you the filtered data. 

The only way I know to do it with AJAX is to write my own smartgrid, or use 
Adobe Spry Framework because it's awesome - and you can just tell web2py 
that you want that dict as a json.

On Monday, March 26, 2012 1:24:42 PM UTC-7, greenpoise wrote:
>
> What I was looking for was a type-ahead function using SQLFORM.smartgrid 
> instead of typing a word and pressing search.
>
>
>
>
>
>
>
>
> On Thursday, 22 March 2012 16:15:23 UTC-7, Alan Etkin wrote:
>>
>> I think you mean SQLFORM.smartgrid. 
>>
>> Book's 7.8 section (the features are explained there): 
>>
>> "... 
>> A SQLFORM.smartgrid looks a lot like a grid, in fact it contains a 
>> grid but it is 
>> designed to take as input not a query but only one table and to browse 
>> said 
>> table and selected referencing tables. 
>> ..." 
>>
>> On Mar 22, 7:16 pm, greenpoise  wrote: 
>> > Are these two equivalents?? I remember using smartables at some point. 
>> What 
>> > I liked about it was the search feature without having to press any 
>> button 
>> > to search for my text within a table. Does SQLFORM.grid provides 
>> something 
>> > similar?? 
>> > 
>> > Thanks 
>> > 
>> > d
>
>

[web2py] Re: Smarttable & SQLFORM.grid

2012-03-29 Thread greenpoise
Powertable is the one I was working on. I just wish I could somehow 
implement an 'add record' function to the + button. 






On Thursday, 29 March 2012 11:55:33 UTC-7, greenpoise wrote:
>
> Will check! Thanks 
>
>
>
>
>
>
> On Wednesday, 28 March 2012 18:59:34 UTC-7, tomt wrote:
>>
>> You may be thinking of 'powertable'.  This plugin presents a grid that 
>> includes a typeahead search 
>> function. It can be found at https://bitbucket.org/rochacbruno/powertable
>> .
>>
>> - Tom
>>
>> On Monday, March 26, 2012 2:24:42 PM UTC-6, greenpoise wrote:
>>>
>>> What I was looking for was a type-ahead function using SQLFORM.smartgrid 
>>> instead of typing a word and pressing search.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Thursday, 22 March 2012 16:15:23 UTC-7, Alan Etkin wrote:

 I think you mean SQLFORM.smartgrid. 

 Book's 7.8 section (the features are explained there): 

 "... 
 A SQLFORM.smartgrid looks a lot like a grid, in fact it contains a 
 grid but it is 
 designed to take as input not a query but only one table and to browse 
 said 
 table and selected referencing tables. 
 ..." 

 On Mar 22, 7:16 pm, greenpoise  wrote: 
 > Are these two equivalents?? I remember using smartables at some 
 point. What 
 > I liked about it was the search feature without having to press any 
 button 
 > to search for my text within a table. Does SQLFORM.grid provides 
 something 
 > similar?? 
 > 
 > Thanks 
 > 
 > d
>>>
>>>

[web2py] Re: Smarttable & SQLFORM.grid

2012-03-29 Thread greenpoise
Will check! Thanks 






On Wednesday, 28 March 2012 18:59:34 UTC-7, tomt wrote:
>
> You may be thinking of 'powertable'.  This plugin presents a grid that 
> includes a typeahead search 
> function. It can be found at https://bitbucket.org/rochacbruno/powertable.
>
> - Tom
>
> On Monday, March 26, 2012 2:24:42 PM UTC-6, greenpoise wrote:
>>
>> What I was looking for was a type-ahead function using SQLFORM.smartgrid 
>> instead of typing a word and pressing search.
>>
>>
>>
>>
>>
>>
>>
>>
>> On Thursday, 22 March 2012 16:15:23 UTC-7, Alan Etkin wrote:
>>>
>>> I think you mean SQLFORM.smartgrid. 
>>>
>>> Book's 7.8 section (the features are explained there): 
>>>
>>> "... 
>>> A SQLFORM.smartgrid looks a lot like a grid, in fact it contains a 
>>> grid but it is 
>>> designed to take as input not a query but only one table and to browse 
>>> said 
>>> table and selected referencing tables. 
>>> ..." 
>>>
>>> On Mar 22, 7:16 pm, greenpoise  wrote: 
>>> > Are these two equivalents?? I remember using smartables at some point. 
>>> What 
>>> > I liked about it was the search feature without having to press any 
>>> button 
>>> > to search for my text within a table. Does SQLFORM.grid provides 
>>> something 
>>> > similar?? 
>>> > 
>>> > Thanks 
>>> > 
>>> > d
>>
>>

[web2py] Re: Smarttable & SQLFORM.grid

2012-03-28 Thread tomt
You may be thinking of 'powertable'.  This plugin presents a grid that 
includes a typeahead search 
function. It can be found at https://bitbucket.org/rochacbruno/powertable.

- Tom

On Monday, March 26, 2012 2:24:42 PM UTC-6, greenpoise wrote:
>
> What I was looking for was a type-ahead function using SQLFORM.smartgrid 
> instead of typing a word and pressing search.
>
>
>
>
>
>
>
>
> On Thursday, 22 March 2012 16:15:23 UTC-7, Alan Etkin wrote:
>>
>> I think you mean SQLFORM.smartgrid. 
>>
>> Book's 7.8 section (the features are explained there): 
>>
>> "... 
>> A SQLFORM.smartgrid looks a lot like a grid, in fact it contains a 
>> grid but it is 
>> designed to take as input not a query but only one table and to browse 
>> said 
>> table and selected referencing tables. 
>> ..." 
>>
>> On Mar 22, 7:16 pm, greenpoise  wrote: 
>> > Are these two equivalents?? I remember using smartables at some point. 
>> What 
>> > I liked about it was the search feature without having to press any 
>> button 
>> > to search for my text within a table. Does SQLFORM.grid provides 
>> something 
>> > similar?? 
>> > 
>> > Thanks 
>> > 
>> > d
>
>

[web2py] Re: Smarttable & SQLFORM.grid

2012-03-26 Thread greenpoise
What I was looking for was a type-ahead function using SQLFORM.smartgrid 
instead of typing a word and pressing search.








On Thursday, 22 March 2012 16:15:23 UTC-7, Alan Etkin wrote:
>
> I think you mean SQLFORM.smartgrid. 
>
> Book's 7.8 section (the features are explained there): 
>
> "... 
> A SQLFORM.smartgrid looks a lot like a grid, in fact it contains a 
> grid but it is 
> designed to take as input not a query but only one table and to browse 
> said 
> table and selected referencing tables. 
> ..." 
>
> On Mar 22, 7:16 pm, greenpoise  wrote: 
> > Are these two equivalents?? I remember using smartables at some point. 
> What 
> > I liked about it was the search feature without having to press any 
> button 
> > to search for my text within a table. Does SQLFORM.grid provides 
> something 
> > similar?? 
> > 
> > Thanks 
> > 
> > d



[web2py] Re: Smarttable & SQLFORM.grid

2012-03-22 Thread greenpoise
Thanks..I thought I was in that chapter...Thanks again..will try the 
examples.


d



On Thursday, 22 March 2012 16:15:23 UTC-7, Alan Etkin wrote:
>
> I think you mean SQLFORM.smartgrid. 
>
> Book's 7.8 section (the features are explained there): 
>
> "... 
> A SQLFORM.smartgrid looks a lot like a grid, in fact it contains a 
> grid but it is 
> designed to take as input not a query but only one table and to browse 
> said 
> table and selected referencing tables. 
> ..." 
>
> On Mar 22, 7:16 pm, greenpoise  wrote: 
> > Are these two equivalents?? I remember using smartables at some point. 
> What 
> > I liked about it was the search feature without having to press any 
> button 
> > to search for my text within a table. Does SQLFORM.grid provides 
> something 
> > similar?? 
> > 
> > Thanks 
> > 
> > d



[web2py] Re: Smarttable & SQLFORM.grid

2012-03-22 Thread Alan Etkin
I think you mean SQLFORM.smartgrid.

Book's 7.8 section (the features are explained there):

"...
A SQLFORM.smartgrid looks a lot like a grid, in fact it contains a
grid but it is
designed to take as input not a query but only one table and to browse
said
table and selected referencing tables.
..."

On Mar 22, 7:16 pm, greenpoise  wrote:
> Are these two equivalents?? I remember using smartables at some point. What
> I liked about it was the search feature without having to press any button
> to search for my text within a table. Does SQLFORM.grid provides something
> similar??
>
> Thanks
>
> d