Yii 1.1.13.
On /index.php/employee/admin (autogenerated by Gii and then modified by me) search boxes are shown by zii.widgets.grid.CGridView.
How to remove these search boxes altogether? I want the table without search.
(Note that I don't want search because it misbehaves with my composite models synthesizing data from several tables and transforming it into a different data format for UI than the data format in DB.)
When creating the zii.widgets.grid.CGridView set the property filter to null.
$this->widget('zii.widgets.grid.CGridView', array('filter' => null, /* etc */));
Also you can remove completely the 'filter' property.
The error was because of this line:
//'filterModel' => $searchModel,----this is what causes the boxes
I have basically commented this line out and the search boxes aren't shown.
Related
I have a custom contentType "Project Info" and 'Title' property is derrived from "Item".
I want to sort via Title (I'm using rest).
I have created a result source and while using the content type the I get the desired "project-items":
ContentTypeId:0x0100A5C45A8A8F7F904EA9BDB82895CC00C6*
So far so good...
I've tried to use "Refinablestring00" and map properties similar to 'Title' managed property.
Then I try to sort the result source via "refinablestring00" and it doesnt work.
Am I missing a mapped property, or what am I doing wrong?
I think the issue is the Mappings to Crawled Properties setting that is forced on the OOTB RefineableStrings. The Title Managed Property is set Include content from the first crawled property that contains information, but the RefinableStrings all have the forced setting in SharePoint Online of Include Content From All Crawled Properties. Because of this, if a search result has data for more than one of the mapped crawled properties, this could affect your sort order.
Unfortunately I think this is a big short coming to SPO when it comes to Search customization that hopefully will be addressed in the future as they learn better ways to manage Search across multiple tenancies.
What I would suggest is altering the mappings to only include one crawled property (the one that corresponds with the SharePoint list item Title field) and this should give you a result that's closer to what you're looking for.
I am using a Multiple Document Selector field on one of my document types, so the user can select many documents they like.
Now I would like to loop through each of those documents and apply some HTML tags, my current solution applies the same rule to all of those documents, what I need to be able to do is find the second document that has been selected on the multiple document selector and apply a different rule!
Does anyone know how I can find the second element or any single element from the multiple document selector control.
Hope someone can help me.
Thank you
The Multiple Document Selector is not a standard Kentico control so I don't know how the value is stored but I guess it's something like comma-separated list of NodeAliasPaths. E.g.:
/News/News-1, /Products/Phones, /Services
In that case you can use K# macro:
Documents["/Page"].MutipleDocumentField.Split(",")[0]
// Selects the first document in MultipleDocumentField on page with NodeAliasPath == "/Page"
or
CMSContext.CurrentDocument.MutipleDocumentField.Split(",")[1]
// Selects the second document in MultipleDocumentField on the current page
Macros can also use loops and have lots of built-in methods. See the documentation or the following example:
{% foreach (x in Documents["/Home"].SubmitText.Split(",")) {""+x+""} %}
In my case it generates the following HTML:
/Partners
/News
/Services
You can use macros in all web part fields. Try inserting the code e.g. to static text web part.
MediaLibraryPickerField has a seeting named "DisplayedContentTypes". I think it is used to provide only required content types that I want my picker field to select and render. But somehow it is not working.
E.g: I want to select only Image,OEmbed types. I put it in the settings area's text box:
Content Types and Parts
[Image,OEmbed]
A comma separated value of all the content types or content parts to
display.
and saved it. But it is still picking all kind of media and rendering them.
Any thing I might be missing here??
There is an open issue here https://orchard.codeplex.com/workitem/21051
There is no fix yet although.
Indeed, the property exists but is not used.
We should try to implement a filter, as it is done for the content picker field.
I am trying to create a Custom Field Type in SharePoint.
This control has it's value set based on another field in the same list.
Because of this requirement, this field should be displayed only in the Display Mode, and not in the Edit or Create mode.
How do I ensure this?
If I just code the ASCX control to not render a field, the field will show up like this in the Edit and Create mode.
alt text http://www.mannsoftware.com/blog/Lists/Photos/121308_0204_CrossSiteLo6.png
Generally you set the SPField.ReadOnlyField property to True to achieve the desired behaviour for any field. (Don't forget to SPField.Update accordingly!) There is an equivalent CAML attribute for list definitions, I believe.
That said, in your control class deriving from BaseFieldControl, you might just override the RenderFieldForInput() method and not call the base implementation to ensure nothing is rendered during Create or Edit. However, this would still render the field's table row in the form, which is probably not what you want. So to enforce the desired behaviour, use ReadOnlyField and override Update() in your SPField (not field control) class to always have it set to True.
It might be easier to just change this on a list-by-list basis by going to the Advanced section of the List Settings, setting Allow management of content types? to Yes, and then editing your content type to change the value of your field to 'hidden'.
Take a look at this blog post. I think it will give you some ideas. The concept uses different rendering templates based on the mode.
http://sharepoint.nailhead.net/2008/04/creating-rendering-template-that.html
Did you try and set the field as hidden?
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfield.hidden.aspx
Custom FORMS pages for new item and edit item (NewForm.aspx and EditForm.aspx) would be another way to achieve this.
Setting the ShowInEditForm and ShowInNewForm properties solved this for me.
How do you create a lookup column to a Document Library that uses the 'Name' of the document as the lookup value?
I found a blog post that recommends adding another custom field like "FileName" and then using a item reciever to populate the custom field with the value from the Name field but that seems cheesy.
Link to the blog in case people are interested:
http://blogs.msdn.com/pranab/archive/2008/01/08/sharepoint-2007-moss-wss-issue-with-lookup-column-to-doc-lib-name-field.aspx
I've got a bunch of custom document content types that I dont want to clutter with a work around that should really work anyway.
I created a one step workflow to set the title from the name, fired on modify and created. Seems to work and took seconds to create.
One way you can do this (although not the easiest way) is by creating a custom field type that extends the SPFieldLookup class. SharePoint's field editor for Lookup fields purposefully hides any columns types that aren't supported by Lookup fields, but you can create a field editor for your custom field type that shows them.
However, I have created a Lookup column that points to a Name column in a Document Library before, and it probably doesn't work like you'd expect. While the value stored in the lookup column is valid, it doesn't show up right in List view or on the View Properties form.
The solution you posted may actually be the best way to handle this. Lookup fields require some kludges if you want to handle more complex scenarios, but that's because they're not meant to provide the same functionality as a foreign key relationship in a database.
Coding in any form always scares me. So Here's what I did: I simply renamed the Stupid "Title" Field to something else, say "Keywords", since you cant do anything with that field: cant even make it mandatory.
Then I created another Single line field called "Title" and used this field for the Lookups
Well there is a simple solution to that and in might work in some case.
In the nutshell if you make the Title field Mandatory, this will force the user to enter a title. In that manner we can use title field as a lookup field.
Now How to do that?
One you are done create a document library go to the library setting. Select Advance Setting and Select Yes for the option "Allow management of content types?".
Then go back to the Library setting and Under content types select the "Document" Content type. THen Select Title Column and then Select "Required (Must contain information)" and say OK.
Now try uploading a document to this document library. You will see Title field in the form.
Hope this helps
Cheers
Vaqar
You have to add the field as XML with the ShowField as 'FileLeafRef'
var XmlFieldDefinition = "<Field DisplayName='myLookupColumn' Type='LookupMulti' StaticName='myLookupColumn' Name='myLookupColumn' Required='FALSE' List='THE LOOKUP ID HERE' WebId='THE WEB ID HERE' UnlimitedLengthInDocumentLibrary='TRUE' Mult='TRUE' Sortable='FALSE' ShowField='FileLeafRef' />"
Field fld = fieldCollection.AddFieldAsXml(XmlFieldDefinition, true, AddFieldOptions.DefaultValue);
ClientContext.Load(fld);
ClientContext.ExecuteQuery();