Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TIWjQDBGrid changing UI
#30
Please check your modified project here:

http://downloads.atozed.com/intraweb/dem...estCase.7z

A few things that I changed:

1) If you want more control over files being rendered (3rd party JS and CSS) you'd better use the PageContext property (of each form).


Example:

Code:
procedure TIWForm2.IWAppFormRender(Sender: TObject);
begin
  PageContext.AddBodyScriptFile('/files/funcoes.js');
  PageContext.AddLinkFile('/files/styles.css');
  PageContext.AddBodyScriptFile('https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.18/dist/js/bootstrap-select.min.js');
  PageContext.AddLinkFile('https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.18/dist/css/bootstrap-select.min.css');
end;


This is way better than adding stuff directly to the headers or using IWBSAddGlobalxxxx() stuff (although since IW 15.2.34 IWBS code has beem modified to use the PageContext as well, so they are equivalent).

Also notice that each local file path starts with the slash '/'. This is mandatory in IW for files like this. The fact that in some cases "it just works either way" is irrelevant. The official recommendation is to prefix them all with a slash.

I suspect that you should also use a common ancestor form for this kind of stuff (And possibly other common code that you will need in your project). It is really simple to use Visual Form Inheritance in IntraWeb.

2) Some times (and this is a good example) you definitely will need to use !important and add it to your CSS rule (check the modified styles.css and compare with the one you sent me). When each control is rendered dynamically in a big project it becomes virtually impossible to control the order of the files in each form/page. That's why !important exists. Use it.

3) When jQGrid.RenderCDNFiles is false you need to provide the files yourself (you need to download the required files and add them to the wwwroot folder, so IW will use it). Differently from other IW controls, the jQGrid don't include these files (especially because it may conflict with other libraries). Maybe in a future version we will include it, but we will need to include a way for users to disable them, in case they want to user a different version of the same files.
I included the same file used when RenderCDNFiles to the wwwroot folder.

4) I kept the /files/ subfolder (under wwwroot). I recommend you to change the name of this folder. Prior to IW 14, the /files/ subfolder had a special meaning and there is some special code in IW to deal with this case. My suggestion is to separate them into /js/ , /css/ and /images/ folders, for instance. Or... leave everything inside wwwroot folder.

Cheers,
Reply


Messages In This Thread
TIWjQDBGrid changing UI - by Comograma - 07-15-2021, 03:51 PM
RE: TIWjQDBGrid changing UI - by Comograma - 07-15-2021, 05:03 PM
RE: TIWjQDBGrid changing UI - by Comograma - 07-19-2021, 05:32 PM
RE: TIWjQDBGrid changing UI - by Comograma - 07-27-2021, 09:47 AM
RE: TIWjQDBGrid changing UI - by Comograma - 07-27-2021, 02:30 PM
RE: TIWjQDBGrid changing UI - by Comograma - 07-30-2021, 10:45 AM
RE: TIWjQDBGrid changing UI - by Comograma - 08-03-2021, 09:35 AM
RE: TIWjQDBGrid changing UI - by Comograma - 08-02-2021, 11:48 AM
RE: TIWjQDBGrid changing UI - by Comograma - 08-04-2021, 09:18 AM
RE: TIWjQDBGrid changing UI - by Comograma - 08-04-2021, 02:04 PM
RE: TIWjQDBGrid changing UI - by Comograma - 08-09-2021, 11:15 AM
RE: TIWjQDBGrid changing UI - by Comograma - 08-13-2021, 10:03 AM
RE: TIWjQDBGrid changing UI - by Comograma - 08-13-2021, 11:33 AM
RE: TIWjQDBGrid changing UI - by Comograma - 08-13-2021, 03:39 PM
RE: TIWjQDBGrid changing UI - by Alexandre Machado - 08-16-2021, 05:23 AM
RE: TIWjQDBGrid changing UI - by Comograma - 09-01-2021, 11:23 AM
RE: TIWjQDBGrid changing UI - by Comograma - 09-01-2021, 03:31 PM
RE: TIWjQDBGrid changing UI - by Comograma - 09-09-2021, 01:48 PM
RE: TIWjQDBGrid changing UI - by Comograma - 09-15-2021, 09:26 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)