Skip to Content
author's profile photo Former Member
Former Member

Changing the Display Template and Query Template of an existing iGrid

The following code is not working as expected. The Display template does update but the data from the query is not returned. Of course, I have tried to plug in default parameters, but if I try to change the Display Template or Query Template it fails to run after passing the setParams. Your help is appreciated.

function jsChangeGrid(var1, var2) {
	// Attach to the applet at the DOM
	var domGrid = document.iGrid
	// Attach to the grid object
	var objGrid = domGrid.getGridObject();
	// Attach to the query object
	var queryObj = domGrid.getQueryObject();

	// Set query template
	domGrid.setQueryTemplate('Queries/queryTemplate');
	
	// Set display template
        domGrid.setDisplayTemplate('Data/displayTemplate');
	
	// Set the query parameters for the grid object
	queryObj.setParam(1,var1);
	queryObj.setParam(2,var2r);

        // Update the iGrid
	domGrid.updateGrid(true);
}

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 12:47 AM

    Hi Chris

    I have gone through the code and found that its logically makes sense, but I wod like to suggest you some changes to the same which I feel is syntactically incorrect :-

    1. var domGrid = document.iGrid; ---> insert a semicolon there n the part iGrid must be the name of the Applet.

    2. Please check for the path as you have passed them as the parameters to the setQueryTemplate() and setDisplayTemplate().

    3. I am not sure about the suggestion below but I feel that you can create the variable queryObj after you set the Query Template to a new Query Template.

    i mean this order may work :-

    domGrid.setQueryTemplate('Queries/queryTemplate');

    var queryObj = domGrid.getQueryObject();

    queryObj.setParam(1,var1);

    queryObj.setParam(2,var2r); -


    > remove var2r with var2 if i m not wrong.

    Thanks

    Amit Rath

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.