cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Search in GRID is Missing in 9.3.6 Version

pshashipreetham
17-Peridot

Search in GRID is Missing in 9.3.6 Version

Hi,

 

I have been using the Advance Grid in the previous Dashboards. As of now, I have replaced it with the GRID of the PTC Thingworx Version 9.3.6.

 

However, the End user is using the search functionality in Advance Grid, which is not present in the present GRID widget. Do we have any workaround?

 

Thanks,

Shashi Preetham
1 ACCEPTED SOLUTION

Accepted Solutions

Hi,

 

After lot of workarounds and debugging there was no way have a search functionality in the Grid of latest version which 9.3.8. As @Rocko suggested, I ended do the same. Below is code if Some want to reuse it.

//Infotable --> Input Parameyter

let result = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape({
    infoTableName: "InfoTable",
    dataShapeName: "DataShapeName"
});

try
{
    let query = {
    	"filters": {
    		"type": "OR",
    		"filters": [{
    				"type": "LIKE",
    				"fieldName": "DataShapeColumen1",
    				"value": "*" + SearchKey + "*"
    			},
    			{
    				"type": "LIKE",
    				"fieldName": "DataShapeColumen2",
    				"value": "*" + SearchKey + "*"
    			},
    			{
    				"type": "LIKE",
    				"fieldName": "DataShapeColumen3",
    				"value": "*" + SearchKey + "*"
    			},
    			{
    				"type": "LIKE",
    				"fieldName": "DataShapeColumen4",
    				"value": "*" + SearchKey + "*"
    			},
    			{
    				"type": "LIKE",
    				"fieldName": "DataShapeColumen5",
    				"value": "*" + SearchKey + "*"
    			},
    			{
    				"type": "LIKE",
    				"fieldName": "DataShapeColumen6",
    				"value": "*" + SearchKey + "*"
    			},
    			{
    				"type": "LIKE",
    				"fieldName": "DataShapeColumen7",
    				"value": "*" + SearchKey + "*"
    			},
    			{
    				"type": "LIKE",
    				"fieldName": "DataShapeColumen8",
    				"value": "*" + SearchKey + "*"
    			},
    			{
    				"type": "LIKE",
    				"fieldName": "DataShapeColumen9",
    				"value": "*" + SearchKey + "*"
    			}
                        
    		]
    	}
    };

    let params = {
        t: Infotable /* INFOTABLE */,
        query: query /* QUERY */
    };
    result = Resources["InfoTableFunctions"].Query(params);
}
catch(e)
{
    result =  Infotable;
    logger.error("ThingName >>> ServiceName >>> Error: "+e+" LineNumber:"+e.lineNumber);
}


 

Thanks @Rocko for your responses and help.

 

Thanks,

Shashi Preetham

View solution in original post

4 REPLIES 4

If you need a search over all columns and not just filtering, you could use a text widget where you enter the search term and pass that to the service that delivers you the infotable shown in the grid. In that service you could then use Resources["InfoTableFunctions"].Query to query all columns for the search term and return only the matching ones.

Hi @@Rocko ,

 

We can do that, but why Search functionality is removed? I have 22 mashups, where Users are using these functionalities, if this is removed suddenly, we are in trouble.

 

Thanks,

Shashi Preetham

It was not removed - Grid is a different widget than Advanced Grid. You can use Advanced Grid, it is still supported.

If you want/need Search in Grid, post it as an Idea in the relevant group and/or ask PTC support about its status. Maybe it's on the roadmap already, but if not, make sure it gets there.

Hi,

 

After lot of workarounds and debugging there was no way have a search functionality in the Grid of latest version which 9.3.8. As @Rocko suggested, I ended do the same. Below is code if Some want to reuse it.

//Infotable --> Input Parameyter

let result = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape({
    infoTableName: "InfoTable",
    dataShapeName: "DataShapeName"
});

try
{
    let query = {
    	"filters": {
    		"type": "OR",
    		"filters": [{
    				"type": "LIKE",
    				"fieldName": "DataShapeColumen1",
    				"value": "*" + SearchKey + "*"
    			},
    			{
    				"type": "LIKE",
    				"fieldName": "DataShapeColumen2",
    				"value": "*" + SearchKey + "*"
    			},
    			{
    				"type": "LIKE",
    				"fieldName": "DataShapeColumen3",
    				"value": "*" + SearchKey + "*"
    			},
    			{
    				"type": "LIKE",
    				"fieldName": "DataShapeColumen4",
    				"value": "*" + SearchKey + "*"
    			},
    			{
    				"type": "LIKE",
    				"fieldName": "DataShapeColumen5",
    				"value": "*" + SearchKey + "*"
    			},
    			{
    				"type": "LIKE",
    				"fieldName": "DataShapeColumen6",
    				"value": "*" + SearchKey + "*"
    			},
    			{
    				"type": "LIKE",
    				"fieldName": "DataShapeColumen7",
    				"value": "*" + SearchKey + "*"
    			},
    			{
    				"type": "LIKE",
    				"fieldName": "DataShapeColumen8",
    				"value": "*" + SearchKey + "*"
    			},
    			{
    				"type": "LIKE",
    				"fieldName": "DataShapeColumen9",
    				"value": "*" + SearchKey + "*"
    			}
                        
    		]
    	}
    };

    let params = {
        t: Infotable /* INFOTABLE */,
        query: query /* QUERY */
    };
    result = Resources["InfoTableFunctions"].Query(params);
}
catch(e)
{
    result =  Infotable;
    logger.error("ThingName >>> ServiceName >>> Error: "+e+" LineNumber:"+e.lineNumber);
}


 

Thanks @Rocko for your responses and help.

 

Thanks,

Shashi Preetham
Top Tags