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

EditSetting:showAddNewRow=true does not show a row

EditSetting:showAddNewRow=true does not show a row however the SAVE button is enabled on the toolbar. If I hit the CANCEL button the new row shows up in edit mode.

What am I doing wrong?



3 Replies

IR Isuriya Rajan Syncfusion Team July 1, 2016 05:48 AM UTC

Hi Duncan,   
  
Thanks for contacting Syncfusion support.   
  
We are unable to reproduce the mention issue “showAddNewRow=true does not show a row however the SAVE button is enabled on the toolbar”. So, please revert us by modifying the sample based on your application along with the replication procedure.   
 
Please share the following details to find the cause of the issue,     
     
1.           Please provide the grid rendering code example.    
2.           Please provide the issue reproduced screen shot.   
3.          Check whether any script error occurs at developer tools console?   
 
   
The “showAddNewRow” property of Grid indicates whether to display the added new form by default in grid.  The “cancel” button helps to cancel the entered value and it undo the grid state which is the default behavior. Please find the screen shot.   
   
The below screen shot indicates if new value is entered in to grid and if we click “cancel’ icon then edit state will be cancelled.   
   

 
And Grid maintain its original state when “showAddNewRow” property is enabled  
 

 
 
It will enable the new empty edited row at the time of cancel and save operations. 
Please find the below attached online documentation and sample link 
 
 
 
Regards, 
Isuriya R. 



DU duncan July 4, 2016 08:19 AM UTC

hI Isuriya,

I can't give you the full example to be honest as my client is a little sensitive, however I think I know what is happening.

As soon as I set showAddNewRow=true I get the error 'CurrentViewData is null' which does not make a lot of sense as the grid binds correctly without this value.
I'm using JSRender templates for some of my columns and  I think that the templates are trying to work with NULL data provided from the Add Row.

Is there a one liner that I can usewithin my JSREnder templates to check for the presence of data. i.e in pseudo-code:

If(CurrenctViewData!=null){
// build the template control
}else{
// do nothing
}

Regards,

Duncan


KK Karthick Kuppusamy Syncfusion Team July 5, 2016 12:06 PM UTC

Hi Duncan,   
  
We are unable to reproduce the reported issue at our end.   
  
Query:   
Is there a one liner that I can usewithin my JSREnder templates to check for the presence of data. i.e in pseudo-code?  
   
we suspect that you are using if and else conditional statement in JsRender template.   
Provided code:   
  
If(CurrenctViewData!=null){
// build the template control
}else{
// do nothing
}
   
   
  
   
   
Please use the below code example instead of your code (Js Render if and else).   
  
<script type="text/x-jsrender" id="columnTemplate">   
                    {{if EmployeeID == 4}}   
                    <div style="color:red">   
                        {{:EmployeeID}}   
                    </div>   
                    {{else}}   
                    <div style="color:green">   
                        {{:EmployeeID}}   
                    </div>   
                    {{/if}}   
                </script>   
  
   
  
Please find the js playground sample.   
  
If we have misunderstood your requirement, please share the following details to validate the issue.  
  
1.Could you please share the detail about essential studio version?   
2.In which scenario you are getting currentview data as null?   
  
Regards,   
K. Karthick  


Loader.
Up arrow icon