Closed taixe closed 2 years ago
@taixe For that you need to use onSearch
and not formatResult
. onSearch
will return the full object, formatResult
is used only to format the string in the results list.
hi @sickdyd . But I want to use formatResult to format data cell, show name, price, image ...
@taixe This can't be done now, but it seems easy to change. You can fork the repo and change this:
{formatResult(result[resultStringKeyName])}
to:
{formatResult(result)}
In Results.js
, and you should get the full result in the callback.
yea, thank @sickdyd
hi! I would like to do this too. I can fork and change as discussed above but I was wondering if it's possible to add it as an option for the function in the official package (whether you want the full results)?
How to I can get full objet data in this function. it only return item is name. I want to get full data item = {name:"", image:"abc", etc...} const formatResult = (item) => { return item; // return (<p dangerouslySetInnerHTML={{__html: ''+item+''}}>
); //To format result as html }