This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When building out the columns in the columns section, only use the following properties | |
- field: The property name in the data object | |
- header: The column header text | |
- type: The data type (text, date, number, etc.) | |
- sortable: Whether the column is sortable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import and use the ItemListComponent in your template | |
- import { ItemListComponent } from '../../components/item-list/item-list.component'; | |
- import { ItemListConfig } from '../../components/item-list/item-list.types'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
field: // name of field | |
header: // header | |
type: // field type | |
sortable: true | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Team | |
name | |
color | |
leaderId (userId) | |
leaderName (User’s display name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`{ | |
field: 'color', | |
header: 'Color', | |
type: 'color', | |
sortable: false, | |
},` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Person> | |
<First>John</First> | |
<Last>Doe</Last> | |
<Age>30</Age> | |
<Email>[email protected]</Email> | |
<PhoneNumbers> | |
<PhoneNumber>123-456-7890</PhoneNumber> | |
<PhoneNumber>098-765-4321</PhoneNumber> | |
</PhoneNumbers> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Utf8StringWriter : StringWriter | |
{ | |
public override Encoding Encoding => Encoding.UTF8; | |
} | |
``` | |
Using this custom writer, we can write our XML in the same way. | |
```C# | |
XmlSerializer serializer = new XmlSerializer(typeof(Person)); | |
using (Utf8StringWriter writer = new Utf8StringWriter()) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-16"?> | |
<Person> | |
<First>John</First> | |
<Last>Doe</Last> | |
<Age>30</Age> | |
<Email>[email protected]</Email> | |
<PhoneNumbers> | |
<PhoneNumber>123-456-7890</PhoneNumber> | |
<PhoneNumber>098-765-4321</PhoneNumber> | |
</PhoneNumbers> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var namespaces = new XmlSerializerNamespaces(); | |
namespaces.Add(string.Empty, string.Empty); | |
XmlSerializer serializer = new XmlSerializer(typeof(Person)); | |
using (StringWriter writer = new StringWriter()) | |
{ | |
serializer.Serialize(writer, person, namespaces); | |
Console.WriteLine(writer.ToString()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-16"?> | |
<Person xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<First>John</First> | |
<Last>Doe</Last> | |
<Email>[email protected]</Email> | |
<PhoneNumbers> | |
<PhoneNumber>123-456-7890</PhoneNumber> | |
<PhoneNumber>098-765-4321</PhoneNumber> | |
</PhoneNumbers> | |
</Person> |
NewerOlder