We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Editing grid dropdown only works once - then "No Records Found"

I'm periodically refreshing a grid using an angular service's subscribe method.  I realize there are other ways but I need to be able to edit the grid so I'm trying to control the refresh by suspending the refresh timer during the edit activity (only 1 column is editable and it's a dropdown).  I struggled with showing the dropdown of options from a static list, but finally got it to work.  However, after the first edit my dropdown no longer works it says "No Records Found".  Any idea why?  Is there a better way to do this?

        <ejs-grid #grid id="queueGrid" [dataSource]='queueList' [editSettings]='editSettings' 
                                       [toolbar]='toolbar' height='515px'  (actionBegin)='actionBegin($event)' > 
...
                <e-column field='priority' headerText='Priority' editType= 'dropdownedit' 
                                            [edit]='priorityParam' width=150></e-column>

   public priorityChoices = [1,2,3,4,5];    

   ngOnInit(): void {
        this.toolbar = ['Edit', 'Delete', 'Update', 'Cancel'];
        this.editSettings = { allowEditing: true };
        this.priorityParam = {
            params: {
                allowFiltering: true,
                dataSource: new DataManager(this.priorityChoices),
                query: new Query(),
                actionComplete: () => false
            }
        };
        // Load the initial queue    
        this.loadQueueData();

        // Start the refreshing
        this.setReloadTimeout();
    }

4 Replies

TS Thavasianand Sankaranarayanan Syncfusion Team May 22, 2019 12:38 PM UTC

Hi Deanna, 

Greetings from Syncfusion support. 

We have already discuss about your query in the following documentation. 


Please let us know if you need further assistance on this.  

Regards, 
Thavasianand S. 



DD Deanna Delapasse May 22, 2019 12:46 PM UTC

I don't see documentation about why the dropdown only works 1 time (or maybe until the grid is refreshed).  Can you point out what is required to make it work > 1 time?


TS Thavasianand Sankaranarayanan Syncfusion Team May 23, 2019 01:22 PM UTC

Hi Deanna,  

Sorry for the inconvenience caused.  

Query: “why the dropdown only works 1 time (or maybe until the grid is refreshed) 

We are able to reproduce the reported behavior at our end when column values does not exist in new dropdownlist data. In this scenario only we are able to reproduce the reported issue. Currently we are validating your query, we will update you the further details by 27th May 2019.  

Till then kindly bound the dataSource directly to dropdownlist instead of DataManager. Refer the below workaround 

this.priorityParam = { 
            params: { 
                allowFiltering: true, 
                dataSource:this.priorityChoices, 
               query: new Query(), 
                actionComplete: () => false 
            } 
        }; 



Regards, 
Thavasianand S. 
20


TS Thavasianand Sankaranarayanan Syncfusion Team May 28, 2019 01:07 PM UTC

Hi Deanna,  

Thanks for the patience.  

To resolve the issue, we suggest you to modify the query property in the actionBegin event of dropdownlist. Refer the below modified code example   

ngOnInit(): void { 
    this.data = orderDatas; 
    this.editSettings = { allowEditing: true, allowAdding: true, allowDeleting: true }; 
    this.toolbar = ['Add', 'Edit', 'Delete', 'Update', 'Cancel']; 
    this.countryParams = { 
        params: { 
           allowFiltering: true, 
            dataSource: new DataManager(this.country), 
            fields: { text: 'countryName', value: 'countryName' }, 
            query: new Query(), 
            actionBegin: onbegin, 
            actionComplete: () => false  
            } 
    }; 
} 
 
} 
function onbegin(args){ 
args.query.queries = []; // modify the query 
} 


For your convenience we have prepared a sample using your code example.  


If above solution does not resolve your issue, please get back to us with more details about the issue.   

Regards, 
Thavasianand S. 


Loader.
Live Chat Icon For mobile
Up arrow icon