Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Paria Shiri 36 posts 109 karma points
    Jan 09, 2024 @ 12:12
    Paria Shiri
    0

    Contentment datapicker not working

    Hello everyone, I'm trying to use Contentment DataPicker with my own data, I have this code:

     public class TestDataPickerSource : IDataPickerSource
        {
    
            public Dictionary<string, object> DefaultValues => default;
    
            public IEnumerable<ConfigurationField> Fields => default;
    
            public string Group => "SSO";
    
            public OverlaySize OverlaySize => OverlaySize.Small;
    
            public string Name => "Test";
    
            public string Description => "testing.";
    
            public string Icon => "icon-umb-users";
    
            public async Task<IEnumerable<DataListItem>> GetItemsAsync(Dictionary<string, object> config, IEnumerable<string> values)
            {
                var items = new List<DataListItem>();
                for (int i = 0; i < 10; i++)
                {
                    items.Add(new DataListItem
                    {
                        Name = "name " + i,
                        Description = "",
                        Value = (i + 1).ToString(),
                    });
                }
                return items;
            }
    
            public async Task<PagedResult<DataListItem>> SearchAsync(Dictionary<string, object> config, int pageNumber = 1, int pageSize = 12, string query = "")
            {
                var items = new PagedResult<DataListItem>(1, pageNumber, pageSize);
    
                return await Task.FromResult(items);
            }
        }
    

    when I select this as a data source it shows me this error and returns noting: enter image description here

    I followed the documentation, have I missed something?

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies