Embedded Widget Option Not Working

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 06:42 AM - edited 04-06-2023 06:43 AM
Hi there,
I am trying to embed the typeahead-search widget into a custom widget with the title option updated so the default text on the search box can be changed. I have tried numerous methods in both client and server scripts to update this and can't seem to make it work.
This is my current code:
HTML:
<div id="cssd-department-header">
<div class="col-md-8">
<h1 class="cssd-dept-label">{{c.options.department}}</h1>
</div>
<div class="col-md-4">
<div class="cssd-search-box">
<sp-widget widget="data.typeAheadWidget"></sp-widget>
</div>
</div>
Client script (the option here is left from another attempt):
function(spUtil) {
/* widget controller */
var c = this;
spUtil.get('typeahead-search').then(function(response){
response.options.title = "Search ASK";
c.typeAheadWidget = response;
});
};
Server Script:
(function() {
var typeAheadOptions = {
// "title": {"value": "Search ASK","displayValue": "Search ASK"}
"title": "Search ASK"
}
data.typeAheadWidget = $sp.getWidget('typeahead-search', typeAheadOptions);
})();
Any idea what I am doing wrong?
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 07:07 AM
Can you try below code:
Client:
function(spUtil) {
/* widget controller */
var c = this;
spUtil.get('typeahead-search', {title: "Search ASK"}).then(function(response){
//response.options.title = "Search ASK";
c.typeAheadWidget1 = response;
});
};
HTML:
<div id="cssd-department-header">
<div class="col-md-8">
<h1 class="cssd-dept-label">{{c.options.department}}</h1>
</div>
<div class="col-md-4">
<div class="cssd-search-box">
<sp-widget widget="c.typeAheadWidget1"></sp-widget>
</div>
</div>
Thank you,
Ali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2023 01:20 AM
Hello ,
This issue is sorted?
Facing same issue.