Hi Jacqueline,

Would it be possible to share what you already have and also provide some more 
detail around how you’re trying to load this widget?

> I can see that in "initialContent" variable is the commented part in the 
> discussionlibrary.html.

`initialContent` corresponds to the first item in the list, which will be used 
to allow managers of the library to create new items. As you say, it is 
actually the output of an HTML template in the widget’s HTML file.

> That is what I want to render. In fact I can render it, but not the way it 
> looks in "My Library”

I’ll need some more information here, but it might be caused by not having the 
correct HTML and CSS structure for the list item component to work.

> I get a lot of problems with the variable "url"  and "query", if I take them 
> out I think "infinityScroll" is not complete.

You definitely need the `url`, as it determines the REST endpoint that will be 
used to load the data shown in the list. For development purposes, this could 
also just point to a static JSON file.

> I also noticed that you have other files in the /3akai-ux/shared/oae/api 
> directory. 

That directory contains all of the core OAE UI APIs. When your widget requires 
`oae.core` at the top, all of these APIs will be passed into your widget. You 
will definitely need this to be able to render templates, as that’s part of the 
OAE util API.

Hope that helps,
Nicolaas


On 19 Mar 2014, at 20:54, Jacqueline Ramos <jackie.l...@gmail.com> wrote:

> Hi everyone.
> 
> I am trying to create a widget like discussionLibrary. I can't even get the 
> bubble image in my widget.
> 
> I noticed that this part of the code does what I want 
> var initialContent = null;
>             if ((widgetData.canAdd || widgetData.canManage) && !query) {
>                 initialContent = 
> oae.api.util.template().render($('#discussionslibrary-list-actions-template', 
> $rootel));
>             }
> 
>             var url = '/api/discussion/library/' + widgetData.context.id;
>             if (query) {
>                 url = '/api/search/discussion-library/' + 
> widgetData.context.id;
>             }
> 
>             // Set up the infinite scroll for the discussions library
>             infinityScroll = $('.oae-list', $rootel).infiniteScroll(url, 
>                       {
>                 'limit': 12,
>                 'q': query
>             }, 
>                       '#discussionslibrary-template', 
>                       {
>                 'initialContent': initialContent,
>                 'postProcessor': function(data) {
>                     // Let the template know whether or not the current list
>                     // is a main list or a search list, as different paging
>                     // keys need to be provided for each
>                     data.query = query;
>                     return data;
>                 },
>                 'emptyListProcessor': function() {
>                     
> oae.api.util.template().render($('#discussionslibrary-noresults-template', 
> $rootel), {
>                         'query': query
>                     }, $('.oae-list', $rootel));
>                 }
>             });
>         };
> 
> I can see that in "initialContent" variable is the commented part in the 
> discussionlibrary.html.
> That is what I want to render. In fact I can render it, but not the way it 
> looks in "My Library"
> I get a lot of problems with the variable "url"  and "query", if I take them 
> out I think "infinityScroll" is not complete.
> I also noticed that you have other files in the /3akai-ux/shared/oae/api 
> directory. 
> Could you please tell me if these files are important for my widget?
> And also What is it that I am doing wrong?
> 
> Thanks in advanced
> Jacqueline
> _______________________________________________
> oae-dev mailing list
> oae-dev@collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/oae-dev

_______________________________________________
oae-dev mailing list
oae-dev@collab.sakaiproject.org
http://collab.sakaiproject.org/mailman/listinfo/oae-dev

Reply via email to