NetTalk Central

Author Topic: Problem with custom CSS in NetTalk 5.33  (Read 4977 times)

Matthew

  • Full Member
  • ***
  • Posts: 137
    • View Profile
    • Email
Problem with custom CSS in NetTalk 5.33
« on: August 31, 2011, 02:50:44 AM »
Hello

I have a problem with my custom css file in NetTalk 5.33. In this file I have some classes which I use to in NetWebBrowse procedure for example to browse header.

In NetTalk 5.29 browse header was created by commands:

packet = clip(packet) & '<th class="'&p_web.combine(MyBrowseHeaderStyle)&'" Title="'&p_web._jsok('Click here to sort by Day')&'">'&p_web.Translate('Day')&'</th>'&CRLF
do AddPacket
 loc:columns += 1

and everything works perfect.

After upgrade NetTalk to version 5.33 browse header was created by commands:

packet = clip(packet) & p_web.CreateSortHeader(loc:vordernumber,'4','MyBrowse',p_web.Translate('Day'),'Click here to sort by Day',,,,,,1,loc:Sorting,'String')
do AddPacket
loc:columns += 1

and after open MyBrowse it has different class called 'nt-left' and preperty 'min-width' which I can't change. So browse header looks different. I found that this class 'nt-left' is permanent in NetWeb.clw in line 7804: packet = clip(packet) & '<div data-role="sh" class="nt-left">'

And one more problem after that:
When I clicked first time on MyBrowse every column change hight of some value.
When I clicked second time on MyBrowse some column change width of some value.
After other clicks MyBrowse remains unchanged.
This is a very strange behavior.

My question is:
Is it any way to not include class nt-left and property min-width which wasn't automatically include in NetTalk 5.29?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Problem with custom CSS in NetTalk 5.33
« Reply #1 on: August 31, 2011, 04:02:32 AM »
I'm not sure of the behaviour changing - perhaps an example of that would be great.

The nt-left, and minwidth settings are there for a reason, and ideally they'd stay there. However you can overide the _contents_ of the nt-left class if you like. I should point out though that the left-alignment of the browse headings is in preparation for Secwin, which adds an icon to the _right_ of the browse heading. coupled with the sort indicator (which appears on the left) this makes the browse behaviour more stable, and fixes a bug which occurred when the browse header dictated the columns width.

So the short answer is - you can override the contents of nt-left, for your browse header, but if you can live with the change I recommend that.

The changing height/width issue - I'd like to see an example of that please (even online would be ok.)

cheers
Bruce

Matthew

  • Full Member
  • ***
  • Posts: 137
    • View Profile
    • Email
Re: Problem with custom CSS in NetTalk 5.33
« Reply #2 on: September 01, 2011, 03:57:15 AM »
Hello Bruce

I have just sent example to You. Please check what's wrong.

Regards,
Matthew

ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
Re: Problem with custom CSS in NetTalk 5.33
« Reply #3 on: September 01, 2011, 07:08:41 AM »
Rather than changing nt-left which would change every nt-left , Try creating a new nt-left just for Table Headers

TH .nt-left {
     float: none;
     }

That would take away the float left properties.
It is also controlled by .ui-widget-header as well.

Chris
   
Real programmers use copy con newapp.exe

Matthew

  • Full Member
  • ***
  • Posts: 137
    • View Profile
    • Email
Re: Problem with custom CSS in NetTalk 5.33
« Reply #4 on: September 02, 2011, 12:20:43 AM »
Thank You for any advice.

After set float to none my browse become wider after every clicked, so it is another problem.

What Can I do to turn off style="min-width: x px" Bruce?
Every browse header has this style, so I can't shorten the column to lower value than min-width if data column has for example only one number.
Even if my browse header is empty this min-width has 32px value and I can't change that.
This default value is probably for SecWin icon which You wrote before.
Could You do something to not include this property if I don't want to use SecWin?
In other words if SecWin is turned off, so I don't need to show any icon, could browse header created similar to NetTalk 5.29?

I really have a problem with size of browse, because I have a lot of column which I formetted in NetTalk 5.29. In version 5.33 my browse is wider and does not fit in frame, so it looks uncomfortable.

Reagrds,
Matthew

Skip Williams

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Email
Re: Problem with custom CSS in NetTalk 5.33
« Reply #5 on: September 02, 2011, 05:55:50 AM »
I second that!

I am still on 5.32 and I don't use Secwin and would hate for my browses to become any wider. I have them set up just right for an iphone and android and if they suddenly become wider, that would be problematic for me as well.

Thanks

Skip

ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
Re: Problem with custom CSS in NetTalk 5.33
« Reply #6 on: September 02, 2011, 06:44:06 AM »
I have to second that as well. Hard-coding or template-coding a style property into the HTML is impossible to get around with css. Please make that a class like .nt-secwincompatiblebrowsecolumnwidth so those of us not using secwin (and even those who are) can control column widths.

While you're at it, can you set up the green bar stuff to use a class, too?  ;D

chris
Real programmers use copy con newapp.exe

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Problem with custom CSS in NetTalk 5.33
« Reply #7 on: September 02, 2011, 08:23:52 PM »
Hi Matthew,

>> After set float to none my browse become wider after every clicked, so it is another problem.

That wasn't happening in the example you sent me Matthew - so if you applied the changes I suggested in my email I don't see that it should happen in yours. However please feel free to resend the example after the updates you've made and I'll take a look.

>> What Can I do to turn off style="min-width: x px" ?

You don't need to turn it off, you can just set it lower;
min-width: 1px ! important;

>> This default value is probably for SecWin icon which You wrote before.

it allows icons to be placed in the header, on both the left side (sort direction marker) and the right side (starting with Secwin, but there are some other things as well.)

>> I really have a problem with size of browse, because I have a lot of column which I formetted in NetTalk 5.29. In version 5.33 my browse is wider and does not fit in frame, so it looks uncomfortable.

you can change it as indicated above. I should point out that you have no control over the width of the screen, or browser program, using your app, so you may be chasing an unachievable goal here. But certainly you can reduce the width (as I've explained).

>> Chis:  Hard-coding or template-coding a style property into the HTML is impossible to get around with css.

that's not true Chris, make use of the !important tag and it should re-do the property.

Cheers
Bruce


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Problem with custom CSS in NetTalk 5.33
« Reply #8 on: September 02, 2011, 09:23:27 PM »
I've removed the min-width setting in 5.34.

cheers
Bruce