Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TIWjQDBGrid changing UI
#31
(08-16-2021, 05:23 AM)Alexandre Machado Wrote: 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,

Thanks for the clarification, Alexandre, that was a good explanation.
Just one thing isn't working in your altered test case project. When you go to Form2 and press the button in front of "Picking nº 1" and than close the modal form, try to click on any of the IWBSSelect components on the form and see what happens. Nothing, the IWBSSelects doesn't dropdown. If you hit that button again and close the modal form again, the IWBSSelects will dropdown...and so on...

Something for you to see so that really works 100%.

Thanks for you effort.
Reply
#32
>> 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.

Alexandre, regarding to the /js/ to put the js files, doesn't work. I must call it what ever but /js/. Don't know why.
Or did said to create those folders under /files/ folder ??!!!!!!!!!!!!!!!!!
Reply
#33
Alexandre, Did you/try see what I post on November 1st about your test case?
Thanks!!!!!!!!!
Reply
#34
I still don't have a solution for it. The problem is that IWBoostrap way of rendering controls during async events is not fully compatible with other parts of IW code. I'm working on a solution but it will probably take a few days at least.
Reply
#35
(09-15-2021, 06:25 AM)Alexandre Machado Wrote: I still don't have a solution for it. The problem is that IWBoostrap way of rendering controls during async events is not fully compatible with other parts of IW code. I'm working on a solution but it will probably take a few days at least.

Thanks anyway. I'll wait patiently!!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)