[ckan-dev] Alter resource in grid view
Dominik Moritz
dominik.moritz at okfn.org
Tue Aug 20 14:23:52 UTC 2013
Hey,
That sounds like you should look at how to limit the data shown and not the data served. If your use case is very specific, you should write your own preview. Look at this answer as a starting point: http://stackoverflow.com/a/17743079. If you data is in the datastore, you can easily filter the results to only get a limited number of rows in the overview view. The full record can then be loaded via Ajax. I don't think that you need to edit any controllers.
You were talking about the recline grid view, right?
Cheers,
Dominik
On 20 Aug 2013, at 15:56, Ben Scott <bnm at benscott.co.uk> wrote:
> Hi Dominik -
>
> Thanks for the reply! Yep, the data is in the datastore - but I don't want to change the actual source data, just alter the view of it in the grid.
>
> The basic use case is: the grid view shows an overview of the resource, and the user can then click through to see the full record. Ive added a controller etc., to enable viewing the full record - but I'm trying to find out how to change the data in the grid display to only show some of the fields.
>
> Cheers,
> Ben
>
>
> On 20 Aug 2013, at 14:09, Dominik Moritz <dominik.moritz at okfn.org> wrote:
>
>> Hi Ben,
>>
>> That depends on where the data comes from. If the preview shows the content of a file (i.e. csv), you have to change the content of the file. If the preview shows the data from the datastore (which is unlikely, but possible), you can use the datastore_upsert action of CKAN [1].
>>
>> Cheers,
>> Dominik
>>
>> [1] http://docs.ckan.org/dv/ckan-2.0.2/datastore-api.html#ckanext.datastore.logic.action.datastore_upsert
>>
>>
>> On 20 Aug 2013, at 12:38, Ben Scott <bnm at benscott.co.uk> wrote:
>>
>>> Hi -
>>>
>>> I'd like to modify the data being displayed when previewing a dataset resource in the grid. What would be the best way of doing that? I've been looking into the IPackageController, but it doesn't seem to let you interact with a package's data resources?
>>>
>>> Thanks very much,
>>> Ben
>>>
>>>
>>> _______________________________________________
>>> ckan-dev mailing list
>>> ckan-dev at lists.okfn.org
>>> http://lists.okfn.org/mailman/listinfo/ckan-dev
>>> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>>
>> Dominik Moritz
>> CKAN developer | skype: d.moritz | @doobly_doo
>> The Open Knowledge Foundation
>> Empowering through Open Knowledge
>> http://okfn.org/ | @okfn | http://ckan.org | @CKANproject
>>
>> _______________________________________________
>> ckan-dev mailing list
>> ckan-dev at lists.okfn.org
>> http://lists.okfn.org/mailman/listinfo/ckan-dev
>> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
Dominik Moritz
CKAN developer | skype: d.moritz | @doobly_doo
The Open Knowledge Foundation
Empowering through Open Knowledge
http://okfn.org/ | @okfn | http://ckan.org | @CKANproject
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130820/e59175d9/attachment-0001.sig>
More information about the ckan-dev
mailing list