238 comments found.
Thanks for your previous responses, I am using MUIDatatable view data much over 100K, but while fetching the data from database is fast, the rendering of the data in MUIDatatable is significantly slow. Is there anything that i might be doing wrong or are there better alternatives to MUIDatatable
Hi golfexodus,
his problem is usually solved by using server side pagination. It should work something like this:
Open page with data table and you fetch first 20 items (or whatever size of a page is). You send /api/tableData?offset=0&limit=20. This will only return first 20 items.
User clicks on next page, you fetch the second page using /api/tableData?offset=20&limit=20. This will return items with id 21-40.
User clicks on next page, you fetch the third page using /api/tableData?offset=20&limit=20
For mui-datatables NPM, it has option serverSide and it helps you to do it easily. Chjeck Remote Data section in the documentation of MUI datatables package https://www.npmjs.com/package/mui-datatables#remote-data.
But if you are sure about your use case and you don’t want to do server side pagination, you can use Web Worker. The problem in your application is that JSON.parse for such a huge collection takes way too long. With Web Worker, you can start another thread that will not block the UI thread. In the worker thread, you will start parsing the collection and when you finish parsing, you will send the data back to the UI thread. Web workers were designed for exactly this use case. You can learn about it more here: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers
Hope this can help.
Regards.
Hello,
Thank you for your nice work. I would like to ask is there any guide to transforming the project in Typescript? Also, do you have the experience to set up the project in monorepo setting?
Thanks.
Hi tony-artanis,
Thanks for purchasing and the appreciation.
Here’s the guide to migrate jsx to typescript https://www.sitepoint.com/how-to-migrate-a-react-app-to-typescript/ and here’s the converter tool https://github.com/lyft/react-javascript-to-typescript-transform
And for monorepo in node.js you can try to use lerna https://lerna.js.org/#getting-started
Feel free if you have any further queries.
Kind regards.
Hallo, I have problems when building my project, my vendor.chunk.js has a size of 9MB, this affects my dashboard performance, how do I optimize the size of my project bundle? thank you
this is my vendor.chunk.js https://ibb.co/DkWWp43
Hallo langgan_id,
Terimakasih telah membeli template kami.
Untuk filesize issue, berikut beberapa cara untuk optimasinya.
1. Pastikan untuk menghindari impor semua dependensi seperti ini
import { object, object2, object3 } from 'plugin/objects';
usahakan menjadi
import object from 'plugin/objects/object'; import object2 from 'plugin/objects/object2'; import object3 from 'plugin/objects/object3';
2. Anda bisa memulai project dari starter-project dan pindahkan components sesuai kebutuhan dari enlite-prime
Semoga bisa membantu.
Salam.
thank you for replying to my question, so I can make the project from scratch, and move redux, routing and components from enlite to my new project.
because right now I didn’t make the project from scratch, but I edited the enlite project that I downloaded, so when it was built, my project size was this big
In MateriaDropZone, is there a way to accept excel files upload only. I have trieed the following:
acceptedFiles={[‘application/vnd.ms-excel’,’application/vnd.openxmlformats-officedocument.wordprocessingml.document’,’application/vnd.openxmlformats-officedocument.spreadsheetml.sheet’]}
but were rejected
Hi golfexodus,
You can try to add acceptedFiles attribute in input tag, like this https://www.codeproject.com/Questions/763540/How-to-browse-only-xls-and-xlsx-file-in-html-file
Hope this can help.
Regards.
Am having difficulty displaying setting inital value for Field as in the code below:
<Field name=”first_name” value={data.first_name} component={TextFieldRedux} placeholder=”First Name” label=”First Name” validate={[required, minLength3, maxLength50]} className={classes.field}/>
The above code is part of an imported/included page, I want to be able to click of a button on the parent page, pass the data to the included page to update the form elements
Hi golfexodus,
If you use TextFieldRedux component, it must be redux-form. And It cannot use value attribute to show the data.
So the value must be filled with initialValues from reduce state. You can see the example usage in app/components/Contact/AddContactForm.js and /app/containers/SampleApps/Contact/reducers/contactReducer.js
Here’s the docs about initialValue for redux-form https://redux-form.com/8.2.2/examples/initializefromstate/
Hope this can help.
Regards.
Hi, Thank you for your Admin dashboard,
I just wondered how can I run only the react front part without using the node server ?
Thanks again, Alexis
Hi Alexix,
Thanks for purchasing,
To run react without node server is possible, but need some adjustment, like change import components/module to constant or load the script in header. Here’s an example https://shinglyu.com/web/2018/02/08/minimal-react-js-without-a-build-step-updated.html
If you have backend system already, we suggest to use 2 server (front end for react with node) and backend, so no need to changea the template structure.
Feel free if you have any further queries.
Kind Regards.
In the search location map, how do I get the lat and long of the newly selected location in onPlacesChanged method. I have tried the available variables and objects inside the method; they only return js functions.
Also how do I set google maps options like panControl={false} mapTypeControl={false} disableDefaultUI={true} and most importantly disable default map labels and icons
Hi golfexodus,
To disable panning you can do like this:
<GoogleMap
defaultZoom={8}
gestureHandling="none"
draggable={false}
defaultCenter={new google.maps.LatLng(41.8507300, -87.6512600)}
defaultOptions={{
draggable: false
}}
>
Also for the rest gMaps api can add in defaultOptions props.
And for onPlacesChanged, you get lat-long, we’re still figuring out how to get this, we’ll let you know once get it.
Regards.
Hi,
About onPlacesChanged, why the return value is always js func, it because it’s unregistered gmap developer. To get lang-lat should be const nextCenter = _.get(nextMarkers, '0.position', this.state.center); or this.state.center
Hope this can help.
Regards.
Thank you, will do for now. Please do let me know of any updates. Great job by the way
Your’e welcome and thanks for the appreciation.
In the search location map, how do I get the lat and long of the newly selected location in onPlacesChanged method. I have tried the available variables and objects inside the method; they only return js functions
We’ve replied to your another message.
I am having difficulty display json data in MUIDataTable using the AdvFilter, below is the data
data: [ {name:”Joe James”, company:”Test Corp”, city:”Yonkers”, state:”NY”}, {name:”John Walsh”, company:”Test Corp”, city:”Hartford”, state:”CT”}, {name:”Bob Herm”, company:”Test Corp”, city:”Tampa”, state:”FL”}, {name:”James Houston”, company:”Test Corp”, city:”Dallas”, state:”TX”} ]
Columns as follows: columns: [ { name: “Name”, field: “name”, options: { filter: true, sort: true, } }, { name: “Company”, field: “company”, options: { filter: true, sort: false, } }, { name: “City”, field: “city”, options: { filter: true, sort: false, } }, { name: “State”, field: “state”, options: { filter: true, sort: false, } }, ]
Options: const options = { filterType: ‘dropdown’, responsive: ‘stacked’, print: false, rowsPerPage: 10, page: 0, jsonMode: true, };
And the render: return ( <MUIDataTable title={“Employee List”} data={data} columns={columns} options={options} /> );
Hi golfexodus,
Thanks for purchasing,
The issue is about columns state. There’s should be no “field” attribute, please follow the correct format or copy from https://github.com/gregnb/mui-datatables
or
[
{
name: "name",
label: "Name",
options: {
filter: true,
sort: true,
}
},
{
name: "company",
label: "Company",
options: {
filter: true,
sort: false,
}
},
{
name: "city",
label: "City",
options: {
filter: true,
sort: false,
}
},
{
name: "state",
label: "State",
options: {
filter: true,
sort: false,
}
},
]
Feel free if you have any further queries.
Regards.
Now working… thanks
Hi ilhammeidi, i’ve just purchased your template Enlite Prime. I would like to know which folders i shouldn’t use/override (which are the core folders of your template), in order to be able to apply future template updates without breaking my implementation.
Thank you in advance!
Hi zarkasb,
Thanks for purchasing,
Here’s folders and files for main of the configuration and skeleton:
UI Components and Wrapper - /app/components/Header/ - /app/components/Sidebar/ - /app/components/SidebarBig/ - /app/containers/App/ThemeWrapper.js - /app/containers/Templates/
Template Config - /app/utils/ - /internals/ - /server/
If any updates we will note the file changes in change log of the documentation.
Feel free if you have any further queries.
Regards.
Hi,
What is the recommended way to get the static images into the build/ directly?
When building the project with ‘npm run build’ the generated ‘build/’ directory doesn’t contain the static images from the ‘public/images’ directory. Is there a recommended way to get then placed correctly in ‘build/’ when using ‘npm run build’? I assume webpack.prod.babel.js needs to be updated but I am not sure the best way to go.
Thanks for your help
Hi NCtrl,
Hope your’e doing well.
To put images into build/ folder you can use import in react components. If the image is larger than 10KB it will put in build folder, else the images will be generated as base64 format inside js file.
Or you can try this webpack plugin https://github.com/webpack-contrib/copy-webpack-plugin You implement that in /internals/webpack/webpack.prod.babel.js
But we recommend to use CDN store the image assets to make image load faster.
Feel free if you have any further queries.
Regards.
Hi there,
Is it possible to keep only one menu level when using big-sidebar?
I have a small application, and having two levels of menu is not good for this scenario.
Thanks
Hi NCtrl,
Thanks for purchasing.
Yes you can modify app/components/SidebarBig/MainMenuBig.js First please remove sub menu container renderChildMenu
<nav className={classNames(classes.listMenu, !drawerPaper && classes.drawerPaperClose)}>
{renderChildMenu()}
</nav>
Then in app/api/ui/menu.js create menu object with link attribute, but without child attribute. like this
{
key: 'no_child',
name: 'One Level Menu',
icon: 'ios-document-outline',
link: '/app/pages/blank-page',
}
Hope this can help. Feel free if you have any further queries.
Regards.
Hi ilhammeidi,
I have problem reading nesting state from the Contact container Init Record and from the Firebase database.
I added a nesting data to Init :
const Init = new Record( { firstName: null, lastName: null, marketingAllowed: false, customerSince: null, key: null, address: null, avatar: null, companyEmail: null, favorited: false, name: null, personalEmail: null, phone: null, secondaryPhone: null, title: null, website: null, id: null, metadata: { businessName: null, note: ‘Nota de Testing’, dobYear: null, dobMonth: null, dobDay: null, modifiedTime: null, }, }
I only can read/wrtie from/to firebase the level 1 of the Record. The console log shows that the metadata is an object .
Any idea on how to fix this?
all the best, Karel
I can read the data in the ContactList and ContactDetail Component , however I can’t read the data on the AddContactForm component. I passed this to the Field component
<Field name=”metadata.note” ..
This doesn’t work
best reagards Karel
Hi Karel,
For attr field name only accept string format. You’re nested form can be wrapped with FormSection https://redux-form.com/8.3.0/docs/api/formsection.md/
Hope this can help. Feel free if you have any further queries.
Regards.
Firebase Realtime DB oder Firebase Firestore DB?
Hi,
Thanks for visiting our portfolio.
This template is using Firebase Realtime DB.
Regards.
How hard would it be to get this to work with the Firestore Version?
Hi ctag,
We’re not sure about firestore, because we haven’t try it. If you’d like you can check Enlite starter version https://github.com/ilhammeidi/enlite-starter
Regards.
Hi I like your both Templates (Dandelion and Enlite prime.) I have 3 questions before purchasing any of one.
1- Both templates seems similar, I in terms of features and technologies. Can you please explain the difference between the features and technologies between these two?
2- I don’t need firebase as backend server. I will use express as backend. Does this template have support for express integration?
3- Is this template Class based or Functions (hooks)?
Hi XEBsoft_Technologies,
We’ve replied in Dandelion comment.
Regards
Hi ,
I hope you are doing well. I use the Starter Project to create my App and now I want to add the Firebase Contact App. I was able to:
1. Copy the Contact app to my project 2. Connect it to Firebase 3. Upload the Data 4. Retrieve the contacts 5. Create a a new Contact
However I can’t update/edit a contact . when I click Edit the from is not populated , I notice that the readux-form INITIALIZE action is not dispached.I also notice that the Form always say ADD NEW Customer in the Title
Could you please help me to fix this problem?
best regards, Karel Cardona
Hi Karel,
Thanks for purchasing and hope your’e doind well too.
First, please try to debug in component /app/components/Contact/AddContactForm.js in AddContactInit with console log.
const AddContactInit = connect(
state => {
console.log(state.getIn(['contact', 'formValues']));
return {
initialValues: state.getIn(['contact', 'formValues']),
...state
};
}
)(AddContactFormRedux);
After that please make sure the initial form data are correct before push to state in /app/containers/SampleFullstackApps/Contact/reducers/contactReducer.js
case EDIT_CONTACT:
return state.withMutations((mutableState) => {
console.log(action.item);
mutableState
.set('openFrm', true)
.set('selectedId', action.item.get('key'))
.set('formValues', action.item)
.set('avatarInit', action.item.get('avatar'));
});
And for the form title, we will update it soon or also can use reducer to manage state title.
Feel free if you have any further queries.
Regards.
Thank you very much. The console log returned undefined on the AddContactInit function . In the contactReducer.js returned all data ok . I don’t what I’m missing , I copy the container and componend from the demo to the starter project . I can Add and remove contacts ok but not Edit .
all the best.
I fixed the problem .
I changed:
initialValues: state.getIn(['contact', 'formValues'])
TO
initialValues: state.getIn(['contactFullstack', 'formValues']),
and now is working fine.
Thank you very much
Glad to hear that and happy coding 
Hi,
I purchased the template and I need a guide as regards to the server folder.
1) How can integrate my own api into the server folder? 2) Does the server have a different port number from the react. React starts with http://localhost:3001. 3) Do you have a documentation on the server?
Hi achorval,
Thanks for purchasing.
1. To add api in server, you can put in server/index.js then use app.use for your api. Here is the article might can help you https://medium.com/@onejohi/building-a-simple-rest-api-with-nodejs-and-express-da6273ed7ca9.
2. To change the port is in folder server/port.jsmodule.exports = parseInt(argv.port || process.env.PORT || 'YOUR PORT', 10);
3. This template focus on front end side, so we use serverless method by use firebase to handle API and just minimum server config. Here’s the docs for firebase https://ilhammeidi.github.io/enlite-docs/#firebase and here for the server https://github.com/react-boilerplate/react-boilerplate/blob/master/docs/general/server-configs.md
Feel free if you have any further queries.
Regards.
Hi ilhammeidi,
I have customized and integrated the api into server/index.js and it’s working very fine. I noticed that after making changes on the server folder and saved, the changes will not reflect, it reflects if I run npm start all over again. But any changes made on the font end side reflects immediately it is saved. How can I make the changes to reflect without running npm start all over again?
Hi achorval,
You can try to use nodemon https://www.npmjs.com/package/nodemon. For usage nodemon server localhost 3000.
Then for front-end changes, we suggest to use default command npm start
Hope this can help.
Regards.
Hi ilhammeidi,
I have installed nodemon and tried to use it but the changes do not reflect immediately. The below is the ‘start’ in my package.json.
“start”: “cross-env NODE_ENV=development node server nodemon server localhost 3001”,
Hi achorval,
The run script can also like this."start": "cross-env NODE_ENV=development node server",
The nodemon will do auto-restart the server, so no need run npm start again. The changes effects might take a time, because need to compile the front-end script as well.
We suggest to separate the api server and front-end side. So the api-server process will faster.
Hope this can help.
Regards.
Hi there,
Is it possible to keep only one menu level? I have a small application, and having two levels of menu is not good for this scenario.
Regards, Vitor
Hi Vitor,
Thanks for purchasing and the review.
The sidebar has designed that icon only for parent(has children) menu. For one menu level can be applied for sidebar-layout. So you need make a modification a bit like this sidebar example.
app/api/ui/menu.js
// add parent menu with linkParent property
{
key: 'home2',
name: 'Home',
icon: 'ios-home-outline',
linkParent: '/sample-link',
},
app/components/Sidebar/MainMenu.js
// make menu type condition in getMenus constant
if (item.child || item.linkParent) {
return (
<div key="{index.toString()}">
{/************** Attention to this ****************/}
<ListItem
component={LinkBtn}
to={item.linkParent ? item.linkParent : '#'}
button
className={
classNames(
classes.head,
item.icon ? classes.iconed : '',
open.indexOf(item.key) > -1 ? classes.opened : '',
)
}
onClick={() => openSubMenu(item.key, item.keyParent)}
>
{item.icon && (
<ListItemIcon className={classes.icon}>
<Ionicon icon={item.icon} />
</ListItemIcon>
)}
<ListItemText classes={{ primary: classes.primary }} variant="inset" primary={item.name} />
{/************** Attention to this ****************/}
{ !item.linkParent && (
<span>
{ open.indexOf(item.key) > -1 ? <ExpandLess /> : <ExpandMore /> }
</span>
)}
</ListItem>
{/************** Attention to this ****************/}
{ !item.linkParent && (
<Collapse
component="div"
className={classNames(
classes.nolist,
(item.keyParent ? classes.child : ''),
)}
in={open.indexOf(item.key) > -1}
timeout="auto"
unmountOnExit
>
<List className={classes.dense} component="nav" dense>
{ getMenus(item.child, 'key') }
</List>
</Collapse>
)}
</div>
);
}
Hope this can help. Feel free if you have any further queries.
Regards.
Hi. Can you help us with how to handle state based on the response coming from the spring boot backend service?
Hi littlejack001,
Thanks for purchasing.
We haven’t to integrate with spring boot backend service. After we research we got tutorial to work with react, please take a look this link https://spring.io/guides/tutorials/react-and-spring-data-rest/
Hope this can help.
Regards.
Hello. I bought your product and it was great. Do you provide html separately, not the entire source reactjs?
Hi nentangonline,
Thanks for purchasing.
Unfortunately this tempalate doesn’t have html version just a react.js.
Feel free if you have any further queries.
Regards.