Many  thanks Alan.

TiddlyTables is one of the great 

On Monday, February 10, 2020 at 1:33:47 AM UTC+3:30, Alan Aldrich wrote:
>
> Hi Mohammad, 
> These are both inherent limitations of working with index values in 
> TiddlyTables. Let me explain...
>
> In your first example, you are trying to sort by an index. There is no 
> simple way to do this in TiddlyWiki and because the table is generated by a 
> filter, no simple way to do this in TiddlyTables. 
> https://groups.google.com/d/topic/tiddlywiki/LJpK7t31G98/discussion
> Here is a thread discussing this issue, and a couple macro-based 
> solutions. In fact, you replied that you would try one of the solutions in 
> your Dynamic Tables plugin. Did you have any success? any 
>
 

> suggestions?
>


Well I used a modified solution by Eric Shulman,


   1. create a list of value===tiddler name
   2. sort the new list of value===tiddler name

here === is connector and is used to create an item. In other word as it is 
difficult to create a two dimensional array, one appends the tiddler title 
to end of value for same index (e.g. column)
after sorting gets back the title and display records.
something like this

\define tableFilter_indexes()  [enlist<items>]+[$(sortneg)$$(sortType)$[]]

\define getitems()<$set name=Index tiddler=<<tempTableSort>> 
index="sortIndex"><$list filter="[subfilter<inputFilter>!has[draft.of]]" 
><$text text="[["/>{{{ [<currentTiddler>getindex<Index>addsuffix[°≡°]] 
}}}<<currentTiddler>><$text text="]]"/></$list></$set>
\end

 
where

\define display_body_indexes()<$wikify name="items" text=<<getitems>> > <$list 
filter=<<tableFilter_indexes>> variable="currentItem" ><$list 
filter="[<currentItem>split[°≡°]last[]]" variable="currentRecord">
 <<display_one_record>></$list></$list></$wikify>
\end

 

> In your second example, you want the plugin to intelligently determine 
> whether to create a new field "ic" or a new index "ic". the way the plugin 
> works is if a field exists with that name it will take precedence over the 
> index. I opted for a simplicity here though I suppose the plugin could make 
> a more advanced decision based on whether that index exists and whether 
> there is already data in the text field. That is the main reason it 
> defaults to field instead of index. There is a risk of accidentally 
> overwriting existing data in the text field if you inadvertently "create an 
> index" by editing.
>
> I agree the documentation could be improved. I wish I had more time. I 
> plan to add something to this effect:
>
> There are some limitations when using indexes as columns. This is due to 
> inherent limitations of index support in filters. The most noticeable is 
> that *index values cannot be sorted*. A mix of fields and indexes can be 
> used as columns in a single table, but there is no way for the user to 
> distinguish a "field" column from an "index" column. If an index and field 
> exist with the same name, it is possible to have a mix of index values and 
> field values in a single column. If a tiddler has both a field and index 
> with the same name or if neither exist, the *field* value will always 
> take precedence whether viewing or editing. 
>
>
Good, this worth to be added to docs.
 

> Thank you for pointing this out. I hope this helps,
> Alan
>


Thanks Alan. TiddlyTables is one the projects shows how amazing, 
sophisticated  and powerful tools can be made using Tiddlywiki with modular 
design.
 

 

>
>
> On Saturday, February 8, 2020 at 10:44:05 PM UTC-6, Mohammad wrote:
>>
>> Hi Alan,
>>  In the latest version of Tiddlytables there seem some small issues
>>
>> A. sort 
>> i. create several data tiddlers tagged with xx like tid1, tid2, tid3,...
>> ii. add an index/value as myindex
>> iii. give different numerical values like 1, 10, 111, 1000
>> v. create a table and sort on myindex
>>
>> The sort does not work.
>>
>>
>> B. edit mode
>> i. create a tiddler of several dataTiddler all tagged with xx and all 
>> with indexes like ia, ib, ic except tid1 which hs indexes ia and ib
>> ii go to edit mode and edit ic for tid1 in the table
>> iii. Tiddlytables creates field ic, while here it is desired to create 
>> index ic
>>
>>
>> C. documentation
>> as TiddlyTables now supports both fields/indexes, the documentation needs 
>> to be improved to reflect this. The current docs are based on table from 
>> fields.
>>
>> --Mohammad
>>
>> --Mohammad
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/0bf25a60-f37e-40f3-b49f-bfaccc13c5b8%40googlegroups.com.

Reply via email to