Skip to main content
Version: 4.2.2

Static Resources

Some JavaScript and CSS files must be included for enabling the grid component visualization. Exists an HTML extension method from the namespace InfoArch.Web.Mvc.UI to import the static files mentioned above. It is recommended to invoke these methods within the <head> tag in the view where it will be used.

Scripts

dReveal uses the GetScripts method to attach the scripts required for the grid component. It receives an instance of the Script class as a parameter, where its property ExtensionSuite requires an ExtensionSuite.Grid value, and another property ExtensionSuite requires an ExtensionSuite.Filter value from the namespace InfoArch.Web.Mvc.Enums.

The following example demonstrates how to attach the dReveal grid component scripts to the view:

<head>
@using InfoArch.Web.Mvc.UI
@using InfoArch.Web.Mvc.Enums

@Html.InfoArch().GetScripts(
new Script { ExtensionSuite = ExtensionSuite.Grid },
new Script { ExtensionSuite = ExtensionSuite.BasicFilters }
)
</head>

StyleSheet

The GetStyleSheets method is used to attach the necessary stylesheet files of the desired dReveal grid component theme. It receives an instance of the StyleSheet class as a parameter, where its property ExtensionType that requires an ExtensionType.Grid value, and another property ExtensionType that requires an ExtensionType.Filters value from the namespace InfoArch.Web.Mvc.Enums.

The following code attaches dReveal grid stylesheets to provide the default appearance.

<head>
@using InfoArch.Web.Mvc.UI
@using InfoArch.Web.Mvc.Enums

@Html.InfoArch().GetStyleSheets(
new StyleSheet { ExtensionType = ExtensionType.Grid },
new StyleSheet { ExtensionType = ExtensionType.BasicFilters }
)
</head>

Third-Party Libraries

dReveal components has third party libraries embedded within needed for its correct work and provide a method to exclude them if the hosting application decide to handle them. The method mentioned above is called RegisterRequiredThirdPartyLibraries. It has two parameters, in the first one, for grid component purpose is required to use RegisterThirdPartyType.Grid, that it is obtained from the namespace InfoArch.Web.Mvc.Enums, the next one is used to specify the third-party libraries to exclude. Some third-party libraries enable to exclude are JQuery and JQueryUI.

<head>
@using InfoArch.Web.Mvc.UI
@using InfoArch.Web.Mvc.Enums

@Html.InfoArch().RegisterRequiredThirdPartyLibraries(
RegisterThirdPartyType.Grid,
RegisterThirdPartyElements.JQuery
)
</head>
note

If the hosting application decide to handle JQuery, this should be referenced before the HTML extension methods provided by dReveal.