attempt rendering of the views using layouts to aid in customizability #67
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Address #57
sample layout is a bootstrap 4 card.
The grid itself will be inserted at the
data
section. To customize the template, i've added an extra key to the config fileAs you can see, changing the view to use for the layout should be easy. The variables in the card template are not mandatory. You can tweak the view the way you want it to be.
However, since the grid uses PJAX, you might as well ensure that you have the ID of the grid's container set. Otherwise, you'll get javascript errors. The layout should start like this;
The class
laravel-grid
is used to apply some preset classes to the HTML elements within the grid, so it is also needed.You can also set this functionality per grid, by calling the
withCustomTemplate
function when creating your grid. Like this;Alternatively, you can override the
getRenderingTemplateToUse
function. By default, it gets the view set in configuration.Setting the view on the config file will make the layout/template apply to all grids created.