@andreadurandogmail-com
@andreadurandogmail-com
Forum Replies Created
-
AuthorPosts
-
Andrea DurandoParticipant
Yestarday I forward to you an E-Mail with the code that i wrote.
Regards
Andrea
Andrea DurandoParticipantHi i do a check for the cache but seems not a problema about it,
and I try to pass directly the response from the API to the dataSource, but the problem still remain.
Any other suggestion?
Andrea DurandoParticipantOk clear thank’s,
I there a way to avoid the Drop operation in dragEnd?
I try with a return false with a eventPreventDefault and a stopPropagation but nothing work
Andrea DurandoParticipanti have another problem about the select the start element, i map the displayMember and the valueMember to a specific fields of a Array of json,
the selection is working fine, but in case i want select programmatically a combobox i have a porblem
I see in the combobox the value of the json and not the label,Eg on stackblitz
https://stackblitz.com/edit/github-wppkr5-m699yc?file=src%2Fapp%2Fapp.component.ts,src%2Fapp%2Fapp.component.htmlI set the value with a specific code and i see the code and not the label in the input of the combobox,
i try to substitute the value with the label, and I see the right text, but the dropdown window is empty like not any element is matchedAndrea DurandoParticipantHi
thanks for the response,
but i try to use your example but is not working (also the example),
<div>could you hel me about that ?</div>
<div></div>Andrea DurandoParticipantHi thanks for the support
It work the inital load,
I try to set the minLength to 0 to make always the search also when i remove all chars, but i notice that the function of the datasource is not triggered, is that right?
For now i try to redo the same thing when i Load the component
<div>
<div>I do a clear of selection and the list of items and i try to read them from the initial elements</div>
<div>combo.clearSelection();</div>
<div> combo.clearItems();</div>
<div> for(let i = 0; i < initialResults.length; i++) {</div>
<div> combo.insert(i, initialResults[i])</div>
<div> }</div>
</div>
<div></div>
<div>But I see only the first element in the dropdown, ay suggestion.</div>
Andrea DurandoParticipantHi Markov,
yes that right but if you take a look on the single button you can see that the Text is not aligned to the verical center but the text is “pushed” to the bottom from “something” using the inspector i see that there is one button element nested,
here the code get with the inspector in the example you linked to me and where i see the text of the button is not rightly centerd:
</div>
<div class=”smart-footer” smart-id=”footer”>
<smart-button class=”cancel smart-element smart-button” id=”button54ed” role=”button”>
<button class=”smart-button smart-unselectable smart-container” type=”button” role=”presentation” smart-id=”button” tabindex=”0″>
<button class=”smart-button smart-unselectable smart-container” type=”button” role=”presentation” smart-id=”button”></button>
Cancel
</button>
</smart-button>
<smart-button class=”agree smart-element smart-button” id=”buttonfb8c” role=”button”>
<button class=”smart-button smart-unselectable smart-container” type=”button” role=”presentation” smart-id=”button” tabindex=”0″>
<button class=”smart-button smart-unselectable smart-container” type=”button” role=”presentation” smart-id=”button”></button>
Agree
</button>
</smart-button>
</div>You can see the two tag button one inside each other.
Andrea DurandoParticipantHi Steven,
I tried to use the solution that you suggested, but it do not work ( the function overwrite the list and I do not see any values, that’s aappen also in ythe example taht you linked to me).
The callback function work great, but now i need in some way to inizialize the list in some way using the API.
Is there a way to trigger it manually?Andrea DurandoParticipantHi Ivanpeevski, that’s clear,
but, apologise me I think I didn’t explain my trouble well,
my question is how can I trigger the callback function to have pre-populate the dropdown elements, and also it should be used when I go to modify it.
I try to move it in ngAfterViewInit as you suggest`ngAfterViewInit(): void { this.combobox.dataSource = (query: string, callback: (val:ComboType[])=>void): void => {
this.combobox.displayLoadingIndicator = true;
if(this.inputParams.dataSource) {
this.inputParams.dataSource.filter((item) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const valLabel: any = item[this.inputParams.labelField as keyof typeof item];
return valLabel.includes(query);
});
}
else {
let queryString: HttpParams = new HttpParams();
if(query.length > 0) {
queryString = queryString.append(“filter”,${this.inputParams.labelField}@=${query}
)
}
this.sysService.getComboBox<ComboType[]>(/${this.inputParams.comboUrl}
, queryString).subscribe((response: HttpResponse<ComboType[]>) => {
this.combobox.displayLoadingIndicator = false;
callback((response.body ?? []));
})
}
}
}But do not fix my issue,
Andrea DurandoParticipantThank you for you response.
Is there a away to execute the ajax call to populate the datasource during the loading of the componentAndrea DurandoParticipantAfter do some more test it start working now,
I do not know why, but I suspect that was a CSS cache problem -
AuthorPosts