Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

How store long text...
 
Notifications
Clear all

How store long texts (solved)

6 Posts
2 Users
0 Reactions
3,666 Views
(@jean-luc)
Posts: 73
Active Member
Topic starter
 
[#1841]

Migrating from other product, I added a column to a table in 'text' format to receive long text data (until more than 32kB in old software), but if the field is displayed, it's only on one line (which scroll with cursor) and no input is possible !

Varchar is too limited to be useable…

How to do ? Help !


 
Posted : 13 Jun 2014 16H28
(@babynus)
Posts: 14952
Member Admin
 

Not planned to use long texts.


 
Posted : 13 Jun 2014 16H38
(@jean-luc)
Posts: 73
Active Member
Topic starter
 

I understand, but I need to know how (and where) change code in Projeqtor to accept text format. It is displayed, no ? even if bad, so it is possible to do.

« Impossible n’est pas français. » 😉


 
Posted : 13 Jun 2014 16H44
(@babynus)
Posts: 14952
Member Admin
 

take into account your new format in /view/objectDetail.php


 
Posted : 13 Jun 2014 17H14
(@jean-luc)
Posts: 73
Active Member
Topic starter
 

I had a look on that module.

Apparently, it should be sufficient to enforce $dataLength value depending on $dataType. 🙂

I'll come back with results after tests.
--------------------------------------------
Coming back with results :

After lines 372-373

$dataType = $obj->getDataType($col);
$dataLength = $obj->getDataLength($col);

I added

 if ($dataType=='text')
	$dataLength = 65535 ;

That works ! :woohoo:

But I don't know yet what's the display when the field is filled with dozen and dozen of lines…


 
Posted : 13 Jun 2014 17H30
(@jean-luc)
Posts: 73
Active Member
Topic starter
 

OK, very long texts give a big window. Functional but not very comfortable.

So it needs to have a scrollbar for the field beyond N lines rather than the scrollbar of the global display window.

Possible to define in the same module ?
-----------------------------------
Yes !
In block beginning with

} else if ($dataLength > 100 and ! array_key_exists('testingMode', $_REQUEST) ){

(around line 1034)
I change

echo ' rows="2" style="width: ' . $largeWidth . 'px;' . $specificStyle . '" ';

to

echo ' rows="2" style="width: ' . $largeWidth . 'px;' . $specificStyle . ';max-height:300px;" ';

… and now I've an input field with its own scrollbar beyond 23 lines. 🙂

Problem solved.


 
Posted : 13 Jun 2014 17H52
Share:

Scroll to Top