HtmlEditor :  Phorum 5 The fastest message board... ever.

This is the discussion forum for the HtmlEditor. See also the HtmlEditor home page, where you can download the control, and the Documentation Wiki, a collaborative project for documenting the control.

Goto Thread: PreviousNext
Goto: Forum ListMessage ListNew TopicSearchLog In
LI renumbering
Posted by: Shari (---.co.marin.ca.us)
Date: Thursday, 15-May-2003, 15:42:20

Does anyone have a suggestion for having more control of the numbering scheme of list items?

My users will want to keep the same numbering scheme, though they may turn off numbering between what they will enter.

Can I intercept the LI command somehow and change the start or value attributes?

Re: LI renumbering
Posted by: Shari (---.co.marin.ca.us)
Date: Thursday, 15-May-2003, 15:47:42

actually, I think I may have figured out one way to go.

I'm going to try explicitly creating a LI element instead of depending on execCommand. I think I should be able to set the attributes that way.

Re: LI renumbering
Posted by: James Hancock (---.darwinconsulting.com)
Date: Thursday, 15-May-2003, 16:05:14

You *SHOULD* be able to pass a parameter to the ExecCommand that will specify it. Check the MSDN documentation.

Re: LI renumbering
Posted by: Shari (---.co.marin.ca.us)
Date: Thursday, 15-May-2003, 16:35:28

I have checked, ad-nauseum. I think the only thing I can pass to it is an ID attribute.

Re: LI renumbering
Posted by: Shari (---.co.marin.ca.us)
Date: Thursday, 15-May-2003, 18:27:48

okay, here's how I did it:

I started with execCommand to turn on the LI, then, I loop through the document and check if the LI tag is anywhere in the element tag. Then, I increment the counter and reset the "value" attribute:

Dim el As mshtml.IHTMLElement = HtmlEditor1.Document.activeElement
Dim elChildren As mshtml.IHTMLElementCollection = CType(el.all, mshtml.IHTMLElementCollection)

Dim currEl As mshtml.IHTMLElement
Dim iLICount As Integer
For Each currEl In elChildren
If currEl.tagName = "LI" Then
If currEl.parentElement.tagName = "OL" Then
currEl.setAttribute("value", iLICount)
iLICount = iLICount + 1
End If
End If
Next



Your Name: 
Your Email: 
Subject: 
Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically.
3TjXG
This is a moderated forum. Your message will remain hidden until it has been approved by a moderator or administrator
This forum powered by Phorum.