Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Unable to try out tw2.jqplugins.jqgrid

22 views
Skip to first unread message

Carson Little

unread,
Jan 14, 2015, 3:54:00 AM1/14/15
to toscawidge...@googlegroups.com
My need is to reformat the google search results for a certain phrase as a spreadsheet.

To that end, it looks like this will help: https://github.com/toscawidgets/tw2.jqplugins.jqgrid

I have never used tw2 before. I'm going to use tw2 standalone backed by a pyramid app (eg: no TurboGears)

After following the instruction/commands exactly on the github page above, could not get this line to run:

(tw2.jqplugins.jqgrid) $ paster tw2.browser

paster was installed using "pip install PasteScript" inside the virtualenv. paster said tw2.browser was not a valid command

Here is what "paster create --list-templates" displays:

    Available templates:
      basic_package:   A basic setuptools-enabled package
      paste_deploy:    A web application deployed through paste.deploy
      tw2.library:     ToscaWidgets widget

tw2.devtools is installed in the same env.

Trying to replace "paster tw2.browser" with "paster tw2.devtools.browser:WbCommand" gives the same error/output

I'm going to use tw2 standalone backed by a pyramid app (eg: no TurboGears)

1. How do I get this running? Should I be using another command or check for certain modules? What debugging information can I post to make this easier to troubleshoot?
2. Once this is up and running with your help, what's the easiest way to test out a "mock" tw2.jqplugins.jqgrid widget? (say by feeding hardcoded JSON or the like)
3. This is maybe a step too far for this question, but if I wanted to add a column to the grid that only contains a checkbox or a button, how can I communicate the state of the checkbox to my backend api without explicitly writing an event listener? (depending on the state of the checkbox or button the row in the grid will change state)

Moritz Schlarb

unread,
Jan 14, 2015, 5:48:30 PM1/14/15
to toscawidge...@googlegroups.com
Hi Carson,

On 14.01.2015 09:54, Carson Little wrote:

> After following the instruction/commands exactly on the github page above,
> could not get this line to run:

Those are a little bit outdated. You would need to run
$ gearbox tw2.server
nowadays. (http://tw2core.readthedocs.org/en/latest/tutorial/#installation)

> paster was installed using "pip install PasteScript" inside the virtualenv.
> paster said tw2.browser was not a valid command

That's also the reason why PasteScript isn't installed as a dependency
anymore, but gearbox is.

> I'm going to use tw2 standalone backed by a pyramid app (eg: no TurboGears)
>
> 1. How do I get this running? Should I be using another command or check
> for certain modules? What debugging information can I post to make this
> easier to troubleshoot?

See above.

> 2. Once this is up and running with your help, what's the easiest way to
> test out a "mock" tw2.jqplugins.jqgrid widget? (say by feeding hardcoded
> JSON or the like)

See the source code for the example widgets:
https://github.com/toscawidgets/tw2.jqplugins.jqgrid/tree/develop/tw2/jqplugins/jqgrid/samples

> 3. This is maybe a step too far for this question, but if I wanted to add a
> column to the grid that only contains a checkbox or a button, how can I
> communicate the state of the checkbox to my backend api without explicitly
> writing an event listener? (depending on the state of the checkbox or
> button the row in the grid will change state)

Can't help you there, sorry.

Regards,
--
Moritz Schlarb

Carson Little

unread,
Jan 14, 2015, 7:19:12 PM1/14/15
to toscawidge...@googlegroups.com
Well thank you Moritz!

Those are a little bit outdated. You would need to run
$ gearbox tw2.server
nowadays. (http://tw2core.readthedocs.org/en/latest/tutorial/#installation)

> paster was installed using "pip install PasteScript" inside the virtualenv.
> paster said tw2.browser was not a valid command

Tried "gearbox tw2.browser" instead of your suggested "gearbox tw2.server" and it spawned a working server on 8001.

I am curious what "gearbox tw2.server" does (my installation of gearbox was not able to locate the command)?

From reading the documentation of tw2 it seems like the need of PasteScript was depreciated and I won't need it to build a tw2 project?

Unfortunately to get the same functionality ("gearbox tw2.browser") using pyramid waitress, it seems like I will have to fall back on paster
 
 
> 3. This is maybe a step too far for this question, but if I wanted to add a
> column to the grid that only contains a checkbox or a button, how can I
> communicate the state of the checkbox to my backend api without explicitly
> writing an event listener? (depending on the state of the checkbox or
> button the row in the grid will change state)

Can't help you there, sorry.

To make some progress with #3, I want to add a column to the tw2.jqplugins.jqgrid grid and that new column will contain a checkbox or a button, and don't have an idea where I should be looking to get that started

Any suggestions to that effect will be highly appreciated.
 

Moritz Schlarb

unread,
Jan 21, 2015, 3:42:41 AM1/21/15
to toscawidge...@googlegroups.com
Hi,

> Tried "gearbox tw2.browser" instead of your suggested "gearbox tw2.server"
> and it spawned a working server on 8001.
>
> I am curious what "gearbox tw2.server" does (my installation of gearbox was
> not able to locate the command)?

You could say that Gearbox is just a framework for running command line
tasks. The tw2.browser subcommand comes from the tw2.devtools package
and starts the ToscaWidgets 2 Widget Browser that displays the samples
for alle installed ToscaWidgets packages.

> From reading the documentation of tw2 it seems like the need of PasteScript
> was depreciated and I won't need it to build a tw2 project?

Gearbox just replaced PasteScript some time ago, the functionality is
about the same. But you won't need any of them for just using
ToscaWidgets (apart from showing you the samples, the tw2.devtools
package is useful for developing new tw2 packages).

> Unfortunately to get the same functionality ("gearbox tw2.browser") using
> pyramid waitress, it seems like I will have to fall back on paster

Definitely not!
ToscaWidgets has a WSGI middleware part that needs to be set up in the
Pyramid processing pipeline and the you just use ToscaWidgets widgets in
your code.
There is a whole chapter in the documentation about using tw2 with
pyramid: http://tw2core.readthedocs.org/en/latest/pyramid/

> To make some progress with #3, I want to add a column to the
> tw2.jqplugins.jqgrid grid and that new column will contain a checkbox or a
> button, and don't have an idea where I should be looking to get that started
>
> Any suggestions to that effect will be highly appreciated.

I always suggest to read the code - in that case of tw2.jqplugins.jqgrid
- to find out how it works and what you can do with it. But the tutorial
about TW2 and Pyramid also has some paragraphs on it, so that might be a
start.

Regards,

--
Moritz Schlarb
Reply all
Reply to author
Forward
0 new messages