How do I get a richlistbox with a fixed listhead?

前端 未结 1 528
不思量自难忘°
不思量自难忘° 2021-01-21 13:15

Targeting Firefox 29+, I\'m trying to create a richlistbox with a listhead, containing listheaders, that should stay fixed at the top if t

相关标签:
1条回答
  • 2021-01-21 13:44

    According to this guy right here: http://mike.kaply.com/2011/08/05/richlistbox-tricks-for-your-add-on/

    You have to do something like this:

      <listheader style="border: 0; padding: 0; -moz-appearance: none;">
        <treecol value="First Header" label="level" pack="end" width="90"/>
        <treecol value="Second Header" label="marker" pack="center" width="115"/>
        <treecol value="Third Header" label="default" pack="center" width="90"/>
        <treecol value="Fourth Header" label="prime" pack="center" width="105"/>
      </listheader>
    

    so that makes your code above like this: you can copy paste this code at http://ted.mielczarek.org/code/mozilla/xuledit/xuledit.xul but you have to download the addon https://addons.mozilla.org/en-US/firefox/addon/remote-xul-manager/?src=ss which whitelists xul urls, and then add this url. then just copy paste this on the site:

    <?xml version="1.0"?>
    <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
    <window id="yourwindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    
    <richlistbox width="400" height="315" seltype="multiple">
      <listheader style="border: 0; padding: 0; -moz-appearance: none;">
        <treecol value="First Header" label="level" pack="end" width="90"/>
        <treecol value="Second Header" label="marker" pack="center" width="115"/>
        <treecol value="Third Header" label="default" pack="center" width="90"/>
        <treecol value="Fourth Header" label="prime" pack="center" width="105"/>
      </listheader>
    <richlistbox>
      <richlistitem>
        <description>A XUL Description!</description>
      </richlistitem>
      <richlistitem>
        <button label="A XUL Button"/>
      </richlistitem>
    </richlistbox>
    <richlistbox>
      <richlistitem>
        <description>A XUL Description!</description>
      </richlistitem>
      <richlistitem>
        <button label="A XUL Button"/>
      </richlistitem>
    </richlistbox>
    <richlistbox>
      <richlistitem>
        <description>A XUL Description!</description>
      </richlistitem>
      <richlistitem>
        <button label="A XUL Button"/>
      </richlistitem>
    </richlistbox>
    <richlistbox>
      <richlistitem>
        <description>A XUL Description!</description>
      </richlistitem>
      <richlistitem>
        <button label="A XUL Button"/>
      </richlistitem>
    </richlistbox>
    <richlistbox>
      <richlistitem>
        <description>A XUL Description!</description>
      </richlistitem>
      <richlistitem>
        <button label="A XUL Button"/>
      </richlistitem>
    </richlistbox>
    <richlistbox>
      <richlistitem>
        <description>A XUL Description!</description>
      </richlistitem>
      <richlistitem>
        <button label="A XUL Button"/>
      </richlistitem>
    </richlistbox>
    <richlistbox>
      <richlistitem>
        <description>A XUL Description!</description>
      </richlistitem>
      <richlistitem>
        <button label="A XUL Button"/>
      </richlistitem>
    </richlistbox>
    </richlistbox>
    
    </window>
    
    0 讨论(0)
提交回复
热议问题