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

Clojurescript

Do you think there's anything in particular that would prevent this library from working with Clojurescript and its various React wrappers? Can the components be fully controlled so that their state is provided via props and onChange actions dispatched via a callback sent into the component, which update a global datastore?

4 Replies

KR Koushik Ramaswamy Syncfusion Team August 28, 2017 12:35 PM UTC

Hi Urban Kristan,  
 
Thanks for contacting Syncfusion support.  
 
Query1:” Do you think there's anything in particular that would prevent this library from working with Clojurescript and its various React wrappers?”  
 
We would like to clarify the following since we are unable to proceed with solution for your query.  
 
  • Are you facing any rendering issues with Syncfusion JavaScript controls when integrated with Clojurescript and React wrappers? If yes share us the error details or sample codes.
  • Whether you are facing trouble in using our Syncfusion ReactJS components with Clojurescript? Or rendering our Syncfusion JavaScript components with Clojurescript in ReactJS using your own React wrappers?
  • Whether “React wrappers” means our Syncfusion react components or you are using other components by creating your own React wrapper?
  • You have mentioned “this library” in the query. Whether this library means our Syncfusion libraries or some other react libraries.
 
Query2:” Can the components be fully controlled so that their state is provided via props and onChange actions dispatched via a callback sent into the component, which update a global datastore?”  
 
Yes, using the state we can set the props using other react component. Also, our Syncfusion React component support the onchange events which will callback. So, we also request you to send the exact component that you are using so that we could help you the best.  
 
 
Please provide the above asked details so that this would help us to analyze and provide you a prompt solution  
 
 
Regards, 
Koushik R 



UK Urban Kristan August 28, 2017 08:28 PM UTC

Thank you for the response. Sorry for not being more specific. It was more a general question regarding integration with Clojurescript. I meant the ReactJS Syncfusion library. Perhaps specifically the spreadsheet component. I can't find a list of props that it accepts. 

By React wrapper I meant Clojurescript libraries which wrap react so that it is more convenient to use with Clojurescript.

So for the spreadsheet component I tried to supply an onChange/onchange callback but it never got called. Is it possible to control the Spreadsheet entirely through props, or is state just derived from the props that the constructor gets initially, so that after the initial mount, subsequent prop changes have no effect (as is written in the docs you linked) ? 

Also: If I have some spreadsheet data present outside of the state of the Spreadsheet component, how do I edit it with the Spreadsheet component? One option would be if I could have a callback which got notified about the changes, so that I could use the information to update the spreadsheet data outside of the Spreadsheet component. Conversely, if I changed the spreadsheet data with something other than the Spreadsheet component, would passing the changed data as new props to the mounted Spreadsheet component update the component's state?  



UK Urban Kristan August 29, 2017 08:09 PM UTC

Yes, so I'm having an issue with the fact that when the Spreadsheet component is only affected by props when its constructor gets called. Subsequent changes to the "sheets" prop have no effect. Same goes for all components. If I want to change the text on a EJ button, passing in new props doesn't work. 




SK Shanmugaraja K Syncfusion Team September 6, 2017 07:27 AM UTC

Hi Urban, 
 
Thanks for your update, 
 
Query 1: spreadsheet component I tried to supply an onChange/onchange callback but it never got called. One option would be if I could have a callback which got notified about the changes 
 
 
We suspect that you need to get event when edit the Spreadsheet, we suggest you to use “cellSave” event. Please refer the below code example, 
 
[JSX] 
 
 
    ReactDOM.render( 
    <ej.spreadsheet scrollsettings-width="100%" scrollsettings-height="550" scrollsettings-isresponsive={true} sheets={sheets} loadcomplete="loadComplete" cellsave="cellSave"> 
    </ej.spreadsheet>, 
    document.getElementById('spreadsheet-default') 
    ); 
 
 
 
 
[JS] 
 
 
        function cellSave(args) { 
            alert("cellSave event triggered"); 
        } 
 
 
 
 
Also, please refer the below event list, 
 
 
Query 2: Subsequent changes to the "sheets" prop have no effect.  
 
 
We suspect that you need to change the sheet data source dynamically, we suggest you to use “updateRange” method to achieve this. Please refer the below code example, 
 
[JS] 
 
 
<input type="button" onclick="updateRange()" value="Update Value"> 
 
        function updateRange() { 
            var settings = { dataSource: [{ Product: "XYZ", Price: "2000", Discount: "10" }, { Product: "XYZ", Price: "2000", Discount: "10" }, { Product: "XYZ", Price: "2000", Discount: "10" }], showHeader: "true", startCell: "J1" }; 
            // To update range of cells with the specified settings 
            // Arguments - sheet index, data settings 
            xlObj.updateRange(1, settings); 
            xlObj.XLFormat.format({ "style": { "font-weight": "bold" } }, "J1:L1"); 
        } 
 
 
 
Please try the below attached sample, and check whether this fulfilling your requirement. If not please get back to us with more details and share your code examples also if possible please share your issue reproducible sample with us. So only we can sort out the issue and provide you a better solution quickly. 
 
 
Please find the below UG documentation link for react JS, 
 
 
Regards,  
Shanmugaraja K  


Loader.
Up arrow icon