Hello everyone, I hope you are good.
In our application we use the Flux approach, with Fluxor library.
Before the 3.0.0 version release, we had no issue to use the Grid component with server side pagination while using Flux. To simplify, let's imagine that we use only one Store, with one simple state :
public record HouseState(List<HouseSimple> Houses, int TotalCount)
In grids components, we used to:
protected void ReadItems(GridReadEventArgs args) {
var page = args.Request.Page;
var filters = args.Request.Filters;
var sorts = args.Request.Sorts;
dispatcher.Dispatch(new LoadHouseAction(page, filters, sorts));
}
As you can see, we get all required information (page, skip etc.), then we dispatch the action. The action will perform an API call, and will create another state with new received data.
<TelerikGrid Data="@State.Houses"
TotalCount="@State.TotalCount"
OnRead="@ReadItems">
We cannot use the "TotalCount" parameter anymore. So we need to use the OnRead event, in order to set the TotalCount in it. In the documentations, all examples are like :
protected async Task ReadItems(GridReadEventArgs args)
{
DataEnvelope DataResult = await FetchPagedData(args.Request.Page, args.Request.PageSize);
args.Data = DataResult.CurrentPageData;
args.Total = DataResult.TotalItemCount;
}
This approach is made to be used with a classic approach to "ask and wait the data". It could work perfectly but in the approach that we use (flux pattern) it is more like "ask and save in state the data, and views use state".
To be able to keep the same functionality of server side pagination, we had to subscribe in our view to the event "the data in the store has been refreshed" and then call the Rebind method of the grid. Something like that:
private void UpdateGridData(AgencesSetAgencesAction action) {
if (GridRef is null) return;
GridRef.Rebind();
}
protected void ReadItems(GridReadEventArgs args) {
var total = this.HousesState.Value..TotaCountl;
var data = this.HousesState.Value.Items;
args.Total = total;
args.Data = data ?? Enumerable.Empty<HouseItem>();
}
It works perfectly, but it seems that we break the Flux approach.
Is there any other way to perform that, while using flux approach or something like it?
Thanks a lot, do not hesitate to ask for some precision.
// Dylan
I am using the radslider and have it oriented horizontally but it displays vertically. I attached a screenshot below.
<div class="column is-half">
Is it possible to make the Stepper align left (when there are more then one Stepper) instead of center?
i.e.
Hi,
I have a combobox loaded with databse values, and I want to set the selected value with the value of my selected record when I open my telerikwindow where my combobox is. Right now it doesn't work.
.razor
<FormItem ColSpan="1">
<Template>
<label for="store-country" class="k-label k-form-label">Pays</label>
<TelerikComboBox Data="@CountryList" TextField="DescFr" ValueField="Id" @bind-Value="@SelectedCountryId" Width="90%"></TelerikComboBox>
</Template>
</FormItem>
.cs
public void StoreEdit(int storeSelected = 0)
Okay, this one is getting me frustrated.
One of the columns that I am retrieving from the database is formatted with HTML and looks like:
17 04 01<br />17 04 02<br />17 04 05<br />20 01 40
Now, when I use webForms, the items will display like this:
17 04 01
17 04 02
17 04 05
20 01 40
However, in blazor they display like:
17 04 01<br />17 04 02<br />17 04 05<br />20 01 40
How can I get them to display like they did in webforms?
I've even tried to split the string and then loop thru the results and I still cannot get them to display on separate lines.
Hello,
I have a model to serve as data in a grid. Besides regular single field data, like strings and numbers etc, the model also contains a List of multiple subitems which need to be added to each row, in a cell. My grid would look like this:
FirstFieldName SecondFieldName ListOfItemsField
------------------------------------------------------------------------------------------------
DataForItemOne DataForItemOne SubItemOneOfItemOne
SubItemTwoOfItemOne
SubItemThreeOfItemOne
------------------------------------------------------------------------------------------------
DataForItemTwo DataForItemTwo SubItemOneOfItemTwo
SubItemTwoOfItemTwo
SubItemThreeOfItemTwo
-----------------------------------------------------------------------------------------------
etc etc etc etc.
My question is: how am I able to add multiple values into a cell? As mentioned, the values belong to a List contained by the model. Each model in the table would have its own List of subitems.
Thank you very much.
Kind regards
Hello.
I'm wondering why the documentation examples in Form section: Automatic Generated Fields doesn't work. I simply copy and paste the example in a clean Blazor project with Telerik for Blazor 3.0.0 and the compiler can't find the definition for FormEditorType.
I don't missing any reference even tried the full namespace that the API documentation indicate and I didn't find any comment that the property is deprecated.
Any ideas?
Regards.
Ludwig.
Good morning all,
I'm taking a look to the new Filter component, recently added to Telerik UI for Blazor.
I'm using it to build conditions to send to a custom SQL Query generator which will build the where clauses mapping from the export of the filter component. You can see my previous question (edited after i figured out a way) here:
https://www.telerik.com/forums/how-to-use-the-new-filter-component-to-create-an-sql-query
The main reason I'm writing you is because I need to add custom items in the list of operators.
Specifically to check an Item against a list, but it's irrelevant I just need an operator that would then be interpreted by the QueryBuilder, I don't need to integrate with other telerik components.
Can I extend some of Telerik classes to implement the functionality I need? Is there any way?
If this is possible in any other way, can you point me in the right direction?
Thank you very much
PS: I tagged this question as General Discussion as it seems like a "Filter" tag is not available yet.
Have a nice day!
FB
Thanks, have a nice day.
I have 2 listviews on a single page.
On one the items are displayed in a single column... one per row.
On the second the items are displayed as a grid. Per the ListView template demo this is done by overriding the k-listview-content class:
.k-listview-content { display: grid; grid-template-columns: repeat(auto-fill, 180px); gap: 30px 20px; }
On that page that screws up the other listview.
Is there a different way to achieve this?
Andy