talk@lists.collectionspace.org

WE HAVE SUNSET THIS LISTSERV - Join us at collectionspace@lyrasislists.org

View all threads

configuring fluid.pager

RL
Ray Lee
Wed, Mar 14, 2012 5:16 AM

Hi Yura,
I'm trying to configure the fluid.pager component with some options. In Demands.js, there is the line:

fluid.demands("fluid.pager", "cspace.search.searchView", ["{searchView}.dom.resultsContainer", fluid.COMPONENT_OPTIONS]);

I changed it to:

fluid.demands("fluid.pager", "cspace.search.searchView", {
	container: "{searchView}.dom.resultsContainer",
	options: fluid.COMPONENT_OPTIONS
});

The documentation at http://wiki.fluidproject.org/display/docs/Demands+Specifications seems to say that these two are equivalent, but with the second form, I get the error

Uncaught TypeError: Object fluid.container was supplied a non-jQueryable element has no method 'fail' CSpaceInfusion.js:10946

Am I missing something?

Thanks,
Ray

Hi Yura, I'm trying to configure the fluid.pager component with some options. In Demands.js, there is the line: fluid.demands("fluid.pager", "cspace.search.searchView", ["{searchView}.dom.resultsContainer", fluid.COMPONENT_OPTIONS]); I changed it to: fluid.demands("fluid.pager", "cspace.search.searchView", { container: "{searchView}.dom.resultsContainer", options: fluid.COMPONENT_OPTIONS }); The documentation at http://wiki.fluidproject.org/display/docs/Demands+Specifications seems to say that these two are equivalent, but with the second form, I get the error Uncaught TypeError: Object fluid.container was supplied a non-jQueryable element has no method 'fail' CSpaceInfusion.js:10946 Am I missing something? Thanks, Ray
ZY
Zenevich, Yura
Wed, Mar 14, 2012 3:01 PM

Hi Ray,

The reason it doesn't work is that fluid.pager is an older component (pre Inversion of Control) and it does not have a grade. Because it does not have a  grade, the framework won't know what arguments to creator function are (e.g. container and options) and thus you have to specify them as args array to the creator function rather than by their name. Hope that helps.

Yura

On 2012-03-14, at 1:16 AM, Ray Lee wrote:

Hi Yura,
I'm trying to configure the fluid.pager component with some options. In Demands.js, there is the line:

fluid.demands("fluid.pager", "cspace.search.searchView", ["{searchView}.dom.resultsContainer", fluid.COMPONENT_OPTIONS]);

I changed it to:

fluid.demands("fluid.pager", "cspace.search.searchView", {
container: "{searchView}.dom.resultsContainer",
options: fluid.COMPONENT_OPTIONS
});

The documentation at http://wiki.fluidproject.org/display/docs/Demands+Specifications seems to say that these two are equivalent, but with the second form, I get the error

Uncaught TypeError: Object fluid.container was supplied a non-jQueryable element has no method 'fail' CSpaceInfusion.js:10946http://cspace:8180/collectionspace/ui/ucjeps/lib/infusion/CSpaceInfusion.js

Am I missing something?

Thanks,
Ray

Hi Ray, The reason it doesn't work is that fluid.pager is an older component (pre Inversion of Control) and it does not have a grade. Because it does not have a grade, the framework won't know what arguments to creator function are (e.g. container and options) and thus you have to specify them as args array to the creator function rather than by their name. Hope that helps. Yura On 2012-03-14, at 1:16 AM, Ray Lee wrote: Hi Yura, I'm trying to configure the fluid.pager component with some options. In Demands.js, there is the line: fluid.demands("fluid.pager", "cspace.search.searchView", ["{searchView}.dom.resultsContainer", fluid.COMPONENT_OPTIONS]); I changed it to: fluid.demands("fluid.pager", "cspace.search.searchView", { container: "{searchView}.dom.resultsContainer", options: fluid.COMPONENT_OPTIONS }); The documentation at http://wiki.fluidproject.org/display/docs/Demands+Specifications seems to say that these two are equivalent, but with the second form, I get the error Uncaught TypeError: Object fluid.container was supplied a non-jQueryable element has no method 'fail' CSpaceInfusion.js:10946<http://cspace:8180/collectionspace/ui/ucjeps/lib/infusion/CSpaceInfusion.js> Am I missing something? Thanks, Ray
RL
Ray Lee
Wed, Mar 14, 2012 11:41 PM

Ok, so what's the right way to specify the options? If I try this:

    fluid.demands("fluid.pager", "cspace.search.searchView", ["{searchView}.dom.resultsContainer", {
        model: {
            pageIndex: undefined,
            pageSize: 50,
            totalRange: undefined
        }
    }]);

I get:

Uncaught TypeError: Object Error in Pager configuration - cannot determine total range,  since not configured in model.totalRange and no PagerBar is configured has no method 'fail'

Which I presume is because now it doesn't know that it should merge the option I specified with options from the parent and/or the defaults. How do I make it do that? I'm just trying to change the default page size.

Thanks,
Ray

On Mar 14, 2012, at 8:01 AM, Zenevich, Yura wrote:

Hi Ray,

The reason it doesn't work is that fluid.pager is an older component (pre Inversion of Control) and it does not have a grade. Because it does not have a  grade, the framework won't know what arguments to creator function are (e.g. container and options) and thus you have to specify them as args array to the creator function rather than by their name. Hope that helps.

Yura

On 2012-03-14, at 1:16 AM, Ray Lee wrote:

Hi Yura,
I'm trying to configure the fluid.pager component with some options. In Demands.js, there is the line:

fluid.demands("fluid.pager", "cspace.search.searchView", ["{searchView}.dom.resultsContainer", fluid.COMPONENT_OPTIONS]);

I changed it to:

fluid.demands("fluid.pager", "cspace.search.searchView", {
container: "{searchView}.dom.resultsContainer",
options: fluid.COMPONENT_OPTIONS
});

The documentation at http://wiki.fluidproject.org/display/docs/Demands+Specifications seems to say that these two are equivalent, but with the second form, I get the error

Uncaught
TypeError: Object fluid.container was supplied a non-jQueryable element has no method 'fail' CSpaceInfusion.js:10946

Am I missing something?

Thanks,
Ray

Ok, so what's the right way to specify the options? If I try this: fluid.demands("fluid.pager", "cspace.search.searchView", ["{searchView}.dom.resultsContainer", { model: { pageIndex: undefined, pageSize: 50, totalRange: undefined } }]); I get: Uncaught TypeError: Object Error in Pager configuration - cannot determine total range, since not configured in model.totalRange and no PagerBar is configured has no method 'fail' Which I presume is because now it doesn't know that it should merge the option I specified with options from the parent and/or the defaults. How do I make it do that? I'm just trying to change the default page size. Thanks, Ray On Mar 14, 2012, at 8:01 AM, Zenevich, Yura wrote: > Hi Ray, > > The reason it doesn't work is that fluid.pager is an older component (pre Inversion of Control) and it does not have a grade. Because it does not have a grade, the framework won't know what arguments to creator function are (e.g. container and options) and thus you have to specify them as args array to the creator function rather than by their name. Hope that helps. > > Yura > > On 2012-03-14, at 1:16 AM, Ray Lee wrote: > >> Hi Yura, >> I'm trying to configure the fluid.pager component with some options. In Demands.js, there is the line: >> >> fluid.demands("fluid.pager", "cspace.search.searchView", ["{searchView}.dom.resultsContainer", fluid.COMPONENT_OPTIONS]); >> >> I changed it to: >> >> fluid.demands("fluid.pager", "cspace.search.searchView", { >> container: "{searchView}.dom.resultsContainer", >> options: fluid.COMPONENT_OPTIONS >> }); >> >> The documentation at http://wiki.fluidproject.org/display/docs/Demands+Specifications seems to say that these two are equivalent, but with the second form, I get the error >> >> >> Uncaught >> TypeError: Object fluid.container was supplied a non-jQueryable element has no method 'fail' CSpaceInfusion.js:10946 >> >> Am I missing something? >> >> Thanks, >> Ray >
ZY
Zenevich, Yura
Thu, Mar 15, 2012 8:06 PM

Hi Ray,

I would try putting the options that you need in config json file for (find edit page, i m assuming that's the one you are working on). And I would suggest just passing the option that you want to modified , so only pageSize without passing undefined pageIndex and totalRange.

Let me know,
Yura

On 2012-03-14, at 7:41 PM, Ray Lee wrote:

Ok, so what's the right way to specify the options? If I try this:

    fluid.demands("fluid.pager", "cspace.search.searchView", ["{searchView}.dom.resultsContainer", {
        model: {
            pageIndex: undefined,
            pageSize: 50,
            totalRange: undefined
        }
    }]);

I get:

Uncaught TypeError: Object Error in Pager configuration - cannot determine total range, since not configured in model.totalRange and no PagerBar is configured has no method 'fail'

Which I presume is because now it doesn't know that it should merge the option I specified with options from the parent and/or the defaults. How do I make it do that? I'm just trying to change the default page size.

Thanks,
Ray

On Mar 14, 2012, at 8:01 AM, Zenevich, Yura wrote:

Hi Ray,

The reason it doesn't work is that fluid.pager is an older component (pre Inversion of Control) and it does not have a grade. Because it does not have a  grade, the framework won't know what arguments to creator function are (e.g. container and options) and thus you have to specify them as args array to the creator function rather than by their name. Hope that helps.

Yura

On 2012-03-14, at 1:16 AM, Ray Lee wrote:

Hi Yura,
I'm trying to configure the fluid.pager component with some options. In Demands.js, there is the line:

fluid.demands("fluid.pager", "cspace.search.searchView", ["{searchView}.dom.resultsContainer", fluid.COMPONENT_OPTIONS]);

I changed it to:

fluid.demands("fluid.pager", "cspace.search.searchView", {
container: "{searchView}.dom.resultsContainer",
options: fluid.COMPONENT_OPTIONS
});

The documentation at http://wiki.fluidproject.org/display/docs/Demands+Specifications seems to say that these two are equivalent, but with the second form, I get the error

Uncaught TypeError: Object fluid.container was supplied a non-jQueryable element has no method 'fail' CSpaceInfusion.js:10946http://cspace:8180/collectionspace/ui/ucjeps/lib/infusion/CSpaceInfusion.js

Am I missing something?

Thanks,
Ray

Hi Ray, I would try putting the options that you need in config json file for (find edit page, i m assuming that's the one you are working on). And I would suggest just passing the option that you want to modified , so only pageSize without passing undefined pageIndex and totalRange. Let me know, Yura On 2012-03-14, at 7:41 PM, Ray Lee wrote: Ok, so what's the right way to specify the options? If I try this: fluid.demands("fluid.pager", "cspace.search.searchView", ["{searchView}.dom.resultsContainer", { model: { pageIndex: undefined, pageSize: 50, totalRange: undefined } }]); I get: Uncaught TypeError: Object Error in Pager configuration - cannot determine total range, since not configured in model.totalRange and no PagerBar is configured has no method 'fail' Which I presume is because now it doesn't know that it should merge the option I specified with options from the parent and/or the defaults. How do I make it do that? I'm just trying to change the default page size. Thanks, Ray On Mar 14, 2012, at 8:01 AM, Zenevich, Yura wrote: Hi Ray, The reason it doesn't work is that fluid.pager is an older component (pre Inversion of Control) and it does not have a grade. Because it does not have a grade, the framework won't know what arguments to creator function are (e.g. container and options) and thus you have to specify them as args array to the creator function rather than by their name. Hope that helps. Yura On 2012-03-14, at 1:16 AM, Ray Lee wrote: Hi Yura, I'm trying to configure the fluid.pager component with some options. In Demands.js, there is the line: fluid.demands("fluid.pager", "cspace.search.searchView", ["{searchView}.dom.resultsContainer", fluid.COMPONENT_OPTIONS]); I changed it to: fluid.demands("fluid.pager", "cspace.search.searchView", { container: "{searchView}.dom.resultsContainer", options: fluid.COMPONENT_OPTIONS }); The documentation at http://wiki.fluidproject.org/display/docs/Demands+Specifications seems to say that these two are equivalent, but with the second form, I get the error Uncaught TypeError: Object fluid.container was supplied a non-jQueryable element has no method 'fail' CSpaceInfusion.js:10946<http://cspace:8180/collectionspace/ui/ucjeps/lib/infusion/CSpaceInfusion.js> Am I missing something? Thanks, Ray
RL
Ray Lee
Fri, Mar 16, 2012 1:42 AM

Ok, I've cracked the code. In config/findedit.json, I added to the "options" under "search", so now it looks like this:

            "search": {
                "type": "cspace.search.searchView",
                "options": {
                    "pivoting": true,
                    "components": {
                        "resultsPager": {
                            "options": {
                                "model": {
                                    "pageSize": 50
                                }
                            }
                        }
                    }
                }
            },

Searching through the source for "cspace.search.searchView" showed that that component is defined in Search.js, and looking through its defaults showed that the subcomponent is named "resultsPager". Looking through the definition of fluid.pager in lib/infusion/CSpaceInfusion.js is how you know that model.pageSize is the right option to set in the pager.

Thanks for the tip, Yura.

Ray

On Mar 15, 2012, at 1:06 PM, Zenevich, Yura wrote:

Hi Ray,

I would try putting the options that you need in config json file for (find edit page, i m assuming that's the one you are working on). And I would suggest just passing the option that you want to modified , so only pageSize without passing undefined pageIndex and totalRange.

Let me know,
Yura

On 2012-03-14, at 7:41 PM, Ray Lee wrote:

Ok, so what's the right way to specify the options? If I try this:

     fluid.demands("fluid.pager", "cspace.search.searchView", ["{searchView}.dom.resultsContainer", {
         model: {
             pageIndex: undefined,
             pageSize: 50,
             totalRange: undefined
         }
     }]);

I get:

Uncaught
TypeError: Object Error in Pager configuration - cannot determine total range, since not configured in model.totalRange and no PagerBar is configured has no method 'fail'

Which I presume is because now it doesn't know that it should merge the option I specified with options from the parent and/or the defaults. How do I make it do that? I'm just trying to change the default page size.

Thanks,
Ray

On Mar 14, 2012, at 8:01 AM, Zenevich, Yura wrote:

Hi Ray,

The reason it doesn't work is that fluid.pager is an older component (pre Inversion of Control) and it does not have a grade. Because it does not have a  grade, the framework won't know what arguments to creator function are (e.g. container and options) and thus you have to specify them as args array to the creator function rather than by their name. Hope that helps.

Yura

On 2012-03-14, at 1:16 AM, Ray Lee wrote:

Hi Yura,
I'm trying to configure the fluid.pager component with some options. In Demands.js, there is the line:

fluid.demands("fluid.pager", "cspace.search.searchView", ["{searchView}.dom.resultsContainer", fluid.COMPONENT_OPTIONS]);

I changed it to:

fluid.demands("fluid.pager", "cspace.search.searchView", {
container: "{searchView}.dom.resultsContainer",
options: fluid.COMPONENT_OPTIONS
});

The documentation at http://wiki.fluidproject.org/display/docs/Demands+Specifications seems to say that these two are equivalent, but with the second form, I get the error

Uncaught
TypeError: Object fluid.container was supplied a non-jQueryable element has no method 'fail' CSpaceInfusion.js:10946

Am I missing something?

Thanks,
Ray

Ok, I've cracked the code. In config/findedit.json, I added to the "options" under "search", so now it looks like this: "search": { "type": "cspace.search.searchView", "options": { "pivoting": true, "components": { "resultsPager": { "options": { "model": { "pageSize": 50 } } } } } }, Searching through the source for "cspace.search.searchView" showed that that component is defined in Search.js, and looking through its defaults showed that the subcomponent is named "resultsPager". Looking through the definition of fluid.pager in lib/infusion/CSpaceInfusion.js is how you know that model.pageSize is the right option to set in the pager. Thanks for the tip, Yura. Ray On Mar 15, 2012, at 1:06 PM, Zenevich, Yura wrote: > Hi Ray, > > I would try putting the options that you need in config json file for (find edit page, i m assuming that's the one you are working on). And I would suggest just passing the option that you want to modified , so only pageSize without passing undefined pageIndex and totalRange. > > Let me know, > Yura > > On 2012-03-14, at 7:41 PM, Ray Lee wrote: > >> Ok, so what's the right way to specify the options? If I try this: >> >> fluid.demands("fluid.pager", "cspace.search.searchView", ["{searchView}.dom.resultsContainer", { >> model: { >> pageIndex: undefined, >> pageSize: 50, >> totalRange: undefined >> } >> }]); >> >> I get: >> >> Uncaught >> TypeError: Object Error in Pager configuration - cannot determine total range, since not configured in model.totalRange and no PagerBar is configured has no method 'fail' >> >> >> >> Which I presume is because now it doesn't know that it should merge the option I specified with options from the parent and/or the defaults. How do I make it do that? I'm just trying to change the default page size. >> >> Thanks, >> Ray >> >> >> On Mar 14, 2012, at 8:01 AM, Zenevich, Yura wrote: >> >>> Hi Ray, >>> >>> The reason it doesn't work is that fluid.pager is an older component (pre Inversion of Control) and it does not have a grade. Because it does not have a grade, the framework won't know what arguments to creator function are (e.g. container and options) and thus you have to specify them as args array to the creator function rather than by their name. Hope that helps. >>> >>> Yura >>> >>> On 2012-03-14, at 1:16 AM, Ray Lee wrote: >>> >>>> Hi Yura, >>>> I'm trying to configure the fluid.pager component with some options. In Demands.js, there is the line: >>>> >>>> fluid.demands("fluid.pager", "cspace.search.searchView", ["{searchView}.dom.resultsContainer", fluid.COMPONENT_OPTIONS]); >>>> >>>> I changed it to: >>>> >>>> fluid.demands("fluid.pager", "cspace.search.searchView", { >>>> container: "{searchView}.dom.resultsContainer", >>>> options: fluid.COMPONENT_OPTIONS >>>> }); >>>> >>>> The documentation at http://wiki.fluidproject.org/display/docs/Demands+Specifications seems to say that these two are equivalent, but with the second form, I get the error >>>> >>>> >>>> Uncaught >>>> TypeError: Object fluid.container was supplied a non-jQueryable element has no method 'fail' CSpaceInfusion.js:10946 >>>> >>>> Am I missing something? >>>> >>>> Thanks, >>>> Ray >>> >> >