Hi,

I am using PagingJSONGrid from the TGExtJS egg, but am have problems
with the data actually displaying.  I get the actual grid and columns
to appear (Including the headings), but the data does not show up.  I
seem to be getting the correct JSON coming back (see below), and in
addition, the correct number of rows appear.  The max entries
increases when I add an object, and the pagination appears correct.
The rows highlight as I move through the grid, just no text.


I am getting an error in Firebug:
------------------------------------------------
l.fireFn is undefined
http://localhost:8080/tg_widgets/TGExtJS/ext-all.js
Line 16
------------------------------------------------
Looks like some event isn't firing, but I am not sure if it is related
to placing the text.

Things I have tried:
1) I have tried removing style.css and this makes no difference.
2) There was also a posting in which the solution was to upgrade to a
new version of  Scriptaculous (Scriptaculous-1.8.0-py2.5.egg). This
does not help.

Below is JSON dump, example code, and tg-admin info dump.  Any help is
appreciated!

Thanks,

Shane



JSON Output ------------------------------ (First page load)
{"tg_flash": null, "items": [{"Description": "crap1", "Options":
"crap1", "id": "crap1", "Name": "crap1"

}, {"Description": "crap2", "Options": "crap2", "id": "crap2", "Name":
"crap2"}, {"Description": "crap3"

, "Options": "crap3", "id": "crap3", "Name": "crap3"}, {"Description":
"crap4", "Options": "crap4", "id"

: "crap4", "Name": "crap4"}, {"Description": "crap5", "Options":
"crap5", "id": "crap5", "Name": "crap5"

}, {"Description": "crap6", "Options": "crap6", "id": "crap6", "Name":
"crap6"}, {"Description": "crap7"

, "Options": "crap7", "id": "crap7", "Name": "crap7"}, {"Description":
"crap8", "Options": "crap8", "id"

: "crap8", "Name": "crap8"}, {"Description": "crap9", "Options":
"crap9", "id": "crap9", "Name": "crap9"

}, {"Description": "crap10", "Options": "crap10", "id": "crap10",
"Name": "crap10"}], "totalCount": 12

}

Code Start Output ------------------------------

from TGExtJS.widgets import PagingJSONGrid

truck_list_settings = {
'metadata': {
    'root': 'items',
    'totalProperty': 'totalCount',
    'id': 'id'
    },
'recordType': [
    {'name': 'ID'},
    {'name': 'Name'},
    {'name': 'Description'},
    {'name': 'Options'},
    ],
'columnModel': [{
            'header': _("ID"),
            'dataIndex': 'id',
            'width': 50,
            'sortable': False
        },{
            'header': _("Name"),
            'dataIndex': 'name',
            'width': 100,
            'sortable': False
        },{
            'header': _("Description"),
            'dataIndex': 'description',
            'width': 250,
            'sortable': False
        }, {
            'header': _("Options"),
            'dataIndex': 'options',
            'width': 25,
            'sortable': False
        }],
'display_message': _("Displaying trucks {0} - {1} of {2}"),
'no_items_message': _("No trucks to display"),
}

paging_grid = PagingJSONGrid()


class CarrierAdminController (controllers.Controller):
    truck_rows = []
    employee_rows = []

    @expose(template="TankerManager.templates.dashboard")
    def index(self):
        log.debug("In CA index.")
        return dict(page_title = "Administrator Dashboard")

    @expose(template="TankerManager.templates.table_view")
    def showTruckTable(self):
        log.debug("In showAjaxTrucks.")
        return dict (form=paging_grid,
                     data_url ='/carrier_admin/refreshTruckList',
                     property_url = '/carrier_admin/grid_settings',
                     page_title = "Truck Management",
                     submodal_method="/carrier_admin/editTruck")

    @tg.expose("json")
    def grid_settings(self):
        return truck_list_settings

    @tg.expose("json")
    @tg.validate(validators={'start': tg.validators.Int(),
                             'limit': tg.validators.Int()})
    def refreshTruckList(self, start = 0, limit = 5):
        log.debug("In CA/refreshTruckList.")
        test_list = ['crap1', 'crap2', 'crap3', 'crap4', 'crap5',
'crap6']
        total = len(test_list)
        rows = []
        for item in test_list[start:start+limit]:
                rows.append({'id':str(item),
                             'Name':str(item),
                             'Description':str(item),
                             'Options':str(item)})
        return dict( totalCount = total,
                     items = rows)


tg-admin info dump
----------------------------------------------------
* TurboGears 1.0.8dev-r5549
* TurboKid 1.0.4
* TurboJson 1.1.4
* TurboCheetah 1.0
* simplejson 1.9.2
* setuptools 0.6c8
* RuleDispatch 0.5a0.dev-r2306
* PasteScript 1.6.3
* FormEncode 1.0.1
* DecoratorTools 1.7
* configobj 4.5.3
* CherryPy 2.3.0
* kid 0.9.6
* Cheetah 2.0.1
* PyProtocols 1.0a0dev-r2302
* PasteDeploy 1.3.2
* Paste 1.7.1
* DecoratorTools 1.7

Toolbox Gadgets

* info (TurboGears 1.0.8dev-r5549)
* catwalk (TurboGears 1.0.8dev-r5549)
* shell (TurboGears 1.0.8dev-r5549)
* designer (TurboGears 1.0.8dev-r5549)
* widgets (TurboGears 1.0.8dev-r5549)
* admi18n (TurboGears 1.0.8dev-r5549)

Identity Providers

* sqlobject (TurboGears 1.0.8dev-r5549)
* sqlalchemy (TurboGears 1.0.8dev-r5549)

tg-admin Commands

* info (TurboGears 1.0.8dev-r5549)
* shell (TurboGears 1.0.8dev-r5549)
* quickstart (TurboGears 1.0.8dev-r5549)
* update (TurboGears 1.0.8dev-r5549)
* sql (TurboGears 1.0.8dev-r5549)
* i18n (TurboGears 1.0.8dev-r5549)
* toolbox (TurboGears 1.0.8dev-r5549)

Visit Managers

* sqlobject (TurboGears 1.0.8dev-r5549)
* sqlalchemy (TurboGears 1.0.8dev-r5549)

Template Engines

* kid (TurboKid 1.0.4)
* json (TurboJson 1.1.4)
* cheetah (TurboCheetah 1.0)

Widget Packages

* submodal (submodal 1.5)
* TGLightWindow (TGLightWindow 2.0)
* TGExtJS (TGExtJS 0.2.3b)
* tgmochikit (tgMochiKit 0.2beta2)
* scriptaculous (Scriptaculous 1.8.0)

TurboGears Extensions

* visit (TurboGears 1.0.8dev-r5549)
* identity (TurboGears 1.0.8dev-r5549)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to